Fix compilation on MSVC, which doesn't understand "inline" with its C99 meaning.
authorRalf Habacker <ralf.habacker@freenet.de>
Sat, 13 Aug 2011 20:08:26 +0000 (22:08 +0200)
committerRalf Habacker <ralf.habacker@freenet.de>
Sat, 13 Aug 2011 20:08:26 +0000 (22:08 +0200)
This fix is limited to msvc compilers only.

Reviewed-by:Simon McVittie <simon.mcvittie@collabora.co.uk>

bus/bus.c
cmake/config.h.cmake
dbus/dbus-internals.c

index f805e3f..6b0dc08 100644 (file)
--- 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)
 {
index aa2343c..b4bfc80 100644 (file)
 #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
index 5e864ce..95a491f 100644 (file)
@@ -301,9 +301,6 @@ static dbus_bool_t verbose = TRUE;
 #include <pthread.h>
 #endif
 
-#ifdef _MSC_VER
-#define inline
-#endif
 #ifdef DBUS_USE_OUTPUT_DEBUG_STRING
 static char module_name[1024];
 #endif