From: Ralf Habacker Date: Sat, 13 Aug 2011 20:08:26 +0000 (+0200) Subject: Fix compilation on MSVC, which doesn't understand "inline" with its C99 meaning. X-Git-Tag: dbus-1.4.16~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4a3e5b0af4046c602c98729a35786273f043bb09;p=platform%2Fupstream%2Fdbus.git Fix compilation on MSVC, which doesn't understand "inline" with its C99 meaning. This fix is limited to msvc compilers only. Reviewed-by:Simon McVittie --- diff --git a/bus/bus.c b/bus/bus.c index f805e3f..6b0dc08 100644 --- a/bus/bus.c +++ b/bus/bus.c @@ -1320,12 +1320,7 @@ out: va_end (args); } -/* TODO: move to autotools generated config.h like done in cmake */ -#ifndef DBUS_INLINE -#define DBUS_INLINE inline -#endif - -static DBUS_INLINE const char * +static 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 aa2343c..b4bfc80 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -253,10 +253,8 @@ #define _dbus_verbose_C_S _dbus_verbose #endif -#ifdef _MSC_VER -#define DBUS_INLINE __inline -#else -#define DBUS_INLINE inline +# if defined(_MSC_VER) && !defined(inline) +#define inline __inline #endif #endif // _DBUS_CONFIG_H diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c index 5e864ce..95a491f 100644 --- a/dbus/dbus-internals.c +++ b/dbus/dbus-internals.c @@ -301,9 +301,6 @@ static dbus_bool_t verbose = TRUE; #include #endif -#ifdef _MSC_VER -#define inline -#endif #ifdef DBUS_USE_OUTPUT_DEBUG_STRING static char module_name[1024]; #endif