GNOME Bugzilla – Bug 584835
MSVC compiler fails with 'static inline' function
Last modified: 2009-06-04 18:55:04 UTC
The MSVC compiler fails with 'static inline' functions. Using 'static __inline' instead fixes the compilation errors. I propose to use the following workarround: #ifdef _MSC_VER #define STIN static __inline #else #define STIN static inline #endif replacing all the 'static inline' sentences with STIN
Could you provide more details? GLib should be defining 'inline' to something appropriate afaik.
I have just updated my GStreamer core sources to 0.10.23 from the 0.10.20 version. I tryed to compile them following the same steps I use with 0.10.20 and I get an error for each function declared 'static inline': Error 8 error C2054: expected '(' to follow 'inline' E:\ossbuild2\Build\Windows\Win32\Release\include\gstreamer-0.10\gst\gstbuffer.h 381 In fact GLib should be defining in glib/gutils.h "inline" to "__inline" but it doesn't. I have checked my glibconfig.h header and it seams to be ok. I have also checked that I'm using the correct preprocessor definitions. As it's more a glib related issue I'll try to figure out what's wrong. Thanks
Solved! My config.h was undefining inline (previously defined by GLib, I supose): #ifndef __cplusplus #undef inline #endif
BTW, this file is under win32/common/config.h and this section should be removed to let GLib how to define inline
Thanks for investigating this. This should hopefully fix it (if not, please re-open): commit c9915b767faf5d3bd24929f5fe803131b1e18b3e Author: Tim-Philipp Müller <tim.muller@collabora.co.uk> Date: Thu Jun 4 19:44:38 2009 +0100 configure: remove AC_C_INLINE and update win32 files to git Remove AC_C_INLINE check, so we don't end up with an #undef inline in config.h, which causes problems with some versions of MSCV apparently. GLib defines inline for us in a suitable way already anyway. Fixes #584835. While we're at it, also update the other win32 files to git (bump version, add new defines and enums).