From: Ralf Habacker Date: Fri, 18 Dec 2009 16:35:43 +0000 (+0100) Subject: DBusPipe related unix compile fix X-Git-Tag: dbus-1.3.1~125 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=68fb041ac3accaf12462d2c5f98992d1d28e4823;p=thirdparty%2Fdbus.git DBusPipe related unix compile fix --- diff --git a/bus/bus.h b/bus/bus.h index 94c64c7eb..aade920cb 100644 --- a/bus/bus.h +++ b/bus/bus.h @@ -29,6 +29,7 @@ #include #include #include +#include typedef struct BusActivation BusActivation; typedef struct BusConnections BusConnections; diff --git a/dbus/dbus-macros.h b/dbus/dbus-macros.h index 497dd4509..379c4e241 100644 --- a/dbus/dbus-macros.h +++ b/dbus/dbus-macros.h @@ -64,6 +64,24 @@ # define _DBUS_GNUC_EXTENSION #endif +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) +#define _DBUS_GNUC_PRINTF( format_idx, arg_idx ) \ + __attribute__((__format__ (__printf__, format_idx, arg_idx))) +#define _DBUS_GNUC_NORETURN \ + __attribute__((__noreturn__)) +#else /* !__GNUC__ */ +#define _DBUS_GNUC_PRINTF( format_idx, arg_idx ) +#define _DBUS_GNUC_NORETURN +#endif /* !__GNUC__ */ + +/** @def _DBUS_GNUC_PRINTF + * used to tell gcc about printf format strings + */ +/** @def _DBUS_GNUC_NORETURN + * used to tell gcc about functions that never return, such as _dbus_abort() + */ + + /* Normally docs are in .c files, but there isn't a .c file for this. */ /** * @defgroup DBusMacros Utility macros diff --git a/dbus/dbus-pipe-unix.c b/dbus/dbus-pipe-unix.c index f3f5e5eb4..79a826f55 100644 --- a/dbus/dbus-pipe-unix.c +++ b/dbus/dbus-pipe-unix.c @@ -26,8 +26,9 @@ #include "dbus-string.h" #include "dbus-internals.h" #include "dbus-pipe.h" +#include "dbus-sysdeps-unix.h" -#include +#include /** * write data to a pipe. diff --git a/dbus/dbus-string.h b/dbus/dbus-string.h index b1850274d..7c3011191 100644 --- a/dbus/dbus-string.h +++ b/dbus/dbus-string.h @@ -27,9 +27,9 @@ #include -#include +#include #include -#include +#include #include @@ -38,6 +38,9 @@ DBUS_BEGIN_DECLS /** * DBusString object */ + +typedef struct DBusString DBusString; + struct DBusString { const void *dummy1; /**< placeholder */ diff --git a/dbus/dbus-sysdeps.h b/dbus/dbus-sysdeps.h index 9ed6bae3a..c8daa25ae 100644 --- a/dbus/dbus-sysdeps.h +++ b/dbus/dbus-sysdeps.h @@ -62,6 +62,7 @@ /** @} */ #include +#include #include /* this is perhaps bogus, but strcmp() etc. are faster if we use the @@ -89,8 +90,6 @@ DBUS_BEGIN_DECLS /* Forward declarations */ -/** An opaque string type */ -typedef struct DBusString DBusString; /** An opaque list type */ typedef struct DBusList DBusList;