From: Ralf Habacker Date: Fri, 5 Aug 2011 21:01:10 +0000 (+0200) Subject: Win32 compile fix. X-Git-Tag: dbus-1.4.16~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0b5f9b1346dbc003b854b2861e7c3b70dac89f2;p=thirdparty%2Fdbus.git Win32 compile fix. msvc compilers define 'inline' only for c++ code, so wrap it with a platform independent DBUS_INLINE define in cmake generated config.h. --- diff --git a/bus/bus.c b/bus/bus.c index 6b0dc088e..f805e3fa1 100644 --- a/bus/bus.c +++ b/bus/bus.c @@ -1320,7 +1320,12 @@ out: va_end (args); } -static inline const char * +/* TODO: move to autotools generated config.h like done in cmake */ +#ifndef DBUS_INLINE +#define DBUS_INLINE inline +#endif + +static DBUS_INLINE const char * nonnull (const char *maybe_null, const char *if_null) { diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake index 6bc6aa564..aa2343cab 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -253,4 +253,10 @@ #define _dbus_verbose_C_S _dbus_verbose #endif +#ifdef _MSC_VER +#define DBUS_INLINE __inline +#else +#define DBUS_INLINE inline +#endif + #endif // _DBUS_CONFIG_H