From b0b5f9b1346dbc003b854b2861e7c3b70dac89f2 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Fri, 5 Aug 2011 23:01:10 +0200 Subject: [PATCH] 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. --- bus/bus.c | 7 ++++++- cmake/config.h.cmake | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bus/bus.c b/bus/bus.c index 6b0dc08..f805e3f 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 6bc6aa5..aa2343c 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 -- 2.7.4