summaryrefslogtreecommitdiff
path: root/dbus
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-07-19 20:37:19 +0100
committerSimon McVittie <smcv@collabora.com>2022-07-19 20:50:33 +0100
commita54ed9ffadcbb2bceebdfb5797e38d49c26289eb (patch)
tree4c83b9174c2bd4cf106ef2e7e9c2f6a74b6d2e75 /dbus
parentbf30fe6d6068bd00ff4b06e667f88e7ca4210cfe (diff)
downloaddbus-a54ed9ffadcbb2bceebdfb5797e38d49c26289eb.tar.gz
Remove emulation of va_copy() in non-C99 compilers
dbus now requires a (mostly-)C99 compiler, which guarantees the presence of Standard C va_copy(). Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'dbus')
-rw-r--r--dbus/dbus-message.c2
-rw-r--r--dbus/dbus-string.c4
-rw-r--r--dbus/dbus-sysdeps-unix.c10
-rw-r--r--dbus/dbus-sysdeps-win.c8
4 files changed, 11 insertions, 13 deletions
diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c
index 4c36aa39..19a43750 100644
--- a/dbus/dbus-message.c
+++ b/dbus/dbus-message.c
@@ -843,7 +843,7 @@ _dbus_message_iter_get_args_valist (DBusMessageIter *iter,
/* copy var_args first, then we can do another iteration over it to
* free memory and close unix fds if parse failed at some point.
*/
- DBUS_VA_COPY (copy_args, var_args);
+ va_copy (copy_args, var_args);
while (spec_type != DBUS_TYPE_INVALID)
{
diff --git a/dbus/dbus-string.c b/dbus/dbus-string.c
index 05c83231..1fecd6dd 100644
--- a/dbus/dbus-string.c
+++ b/dbus/dbus-string.c
@@ -41,8 +41,6 @@
#include "dbus-marshal-basic.h" /* probably should be removed by moving the usage of DBUS_TYPE
* into the marshaling-related files
*/
-/* for DBUS_VA_COPY */
-#include "dbus-sysdeps.h"
/**
* @defgroup DBusString DBusString class
@@ -1112,7 +1110,7 @@ _dbus_string_append_printf_valist (DBusString *str,
DBUS_STRING_PREAMBLE (str);
- DBUS_VA_COPY (args_copy, args);
+ va_copy (args_copy, args);
/* Measure the message length without terminating nul */
len = _dbus_printf_string_upper_bound (format, args);
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
index 18bd1282..252798e3 100644
--- a/dbus/dbus-sysdeps-unix.c
+++ b/dbus/dbus-sysdeps-unix.c
@@ -3825,7 +3825,7 @@ _dbus_printf_string_upper_bound (const char *format,
int len;
va_list args_copy;
- DBUS_VA_COPY (args_copy, args);
+ va_copy (args_copy, args);
len = vsnprintf (static_buf, bufsize, format, args_copy);
va_end (args_copy);
@@ -3843,7 +3843,7 @@ _dbus_printf_string_upper_bound (const char *format,
* or the real length could be coincidentally the same. Which is it?
* If vsnprintf returns the truncated length, we'll go to the slow
* path. */
- DBUS_VA_COPY (args_copy, args);
+ va_copy (args_copy, args);
if (vsnprintf (static_buf, 1, format, args_copy) == 1)
len = -1;
@@ -3864,7 +3864,7 @@ _dbus_printf_string_upper_bound (const char *format,
if (buf == NULL)
return -1;
- DBUS_VA_COPY (args_copy, args);
+ va_copy (args_copy, args);
len = vsnprintf (buf, bufsize, format, args_copy);
va_end (args_copy);
@@ -5097,7 +5097,7 @@ _dbus_logv (DBusSystemLogSeverity severity,
_dbus_assert_not_reached ("invalid log severity");
}
- DBUS_VA_COPY (tmp, args);
+ va_copy (tmp, args);
vsyslog (flags, msg, tmp);
va_end (tmp);
}
@@ -5107,7 +5107,7 @@ _dbus_logv (DBusSystemLogSeverity severity,
if (log_flags & DBUS_LOG_FLAGS_STDERR)
#endif
{
- DBUS_VA_COPY (tmp, args);
+ va_copy (tmp, args);
fprintf (stderr, "%s[" DBUS_PID_FORMAT "]: ", syslog_tag, _dbus_getpid ());
vfprintf (stderr, msg, tmp);
fputc ('\n', stderr);
diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c
index e71f35d2..df4a4ce3 100644
--- a/dbus/dbus-sysdeps-win.c
+++ b/dbus/dbus-sysdeps-win.c
@@ -744,7 +744,7 @@ int _dbus_printf_string_upper_bound (const char *format,
va_list args_copy;
bufsize = sizeof (buf);
- DBUS_VA_COPY (args_copy, args);
+ va_copy (args_copy, args);
len = _vsnprintf (buf, bufsize - 1, format, args_copy);
va_end (args_copy);
@@ -759,7 +759,7 @@ int _dbus_printf_string_upper_bound (const char *format,
if (p == NULL)
return -1;
- DBUS_VA_COPY (args_copy, args);
+ va_copy (args_copy, args);
len = _vsnprintf (p, bufsize - 1, format, args_copy);
va_end (args_copy);
free (p);
@@ -4249,7 +4249,7 @@ _dbus_logv (DBusSystemLogSeverity severity,
{
DBusString out = _DBUS_STRING_INIT_INVALID;
const char *message = NULL;
- DBUS_VA_COPY (tmp, args);
+ va_copy (tmp, args);
if (!_dbus_string_init (&out))
goto out;
@@ -4276,7 +4276,7 @@ out:
if (log_flags & DBUS_LOG_FLAGS_STDERR)
{
- DBUS_VA_COPY (tmp, args);
+ va_copy (tmp, args);
fprintf (stderr, "%s[%lu]: %s: ", log_tag, _dbus_pid_for_log (), s);
vfprintf (stderr, msg, tmp);
fprintf (stderr, "\n");