summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-sysdeps.h
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2004-03-05 14:05:33 +0000
committerDavid Zeuthen <davidz@redhat.com>2004-03-05 14:05:33 +0000
commit868dd4b4b0be082b86354b1f89ed9cffd5b8e193 (patch)
tree73b59bb44eaab572d35ce55dc415d614f68a84fe /dbus/dbus-sysdeps.h
parent47d8e53bfeccc6f90475408bfbef9c0132a4122f (diff)
2004-03-01 David Zeuthen <david@fubar.dk>
* dbus/dbus-string.c (_dbus_string_append_printf_valist): Fix a bug where args were used twice. This bug resulted in a segfault on a Debian/PPC system when starting the messagebus daemon. Include dbus-sysdeps.h for DBUS_VA_COPY * dbus/dbus-sysdeps.h: Define DBUS_VA_COPY if neccessary. From GLib * configure.in: Check for va_copy; define DBUS_VA_COPY to the appropriate va_copy implementation. From GLib
Diffstat (limited to 'dbus/dbus-sysdeps.h')
-rw-r--r--dbus/dbus-sysdeps.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h
index da71f99f..5febc6e6 100644
--- a/dbus/dbus-sysdeps.h
+++ b/dbus/dbus-sysdeps.h
@@ -306,6 +306,20 @@ void _dbus_set_signal_handler (int sig,
DBusSignalHandler handler);
+/* Define DBUS_VA_COPY() to do the right thing for copying va_list variables.
+ * config.h may have already defined DBUS_VA_COPY as va_copy or __va_copy.
+ */
+#if !defined (DBUS_VA_COPY)
+# if defined (__GNUC__) && defined (__PPC__) && (defined (_CALL_SYSV) || defined (_WIN32))
+# define DBUS_VA_COPY(ap1, ap2) (*(ap1) = *(ap2))
+# elif defined (DBUS_VA_COPY_AS_ARRAY)
+# define DBUS_VA_COPY(ap1, ap2) memcpy ((ap1), (ap2), sizeof (va_list))
+# else /* va_list is a pointer */
+# define DBUS_VA_COPY(ap1, ap2) ((ap1) = (ap2))
+# endif /* va_list is a pointer */
+#endif /* !DBUS_VA_COPY */
+
+
DBUS_END_DECLS;
#endif /* DBUS_SYSDEPS_H */