After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 584835 - MSVC compiler fails with 'static inline' function
MSVC compiler fails with 'static inline' function
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.10.23
Other Windows
: Normal normal
: 0.10.24
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-06-04 15:20 UTC by Andoni Morales
Modified: 2009-06-04 18:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andoni Morales 2009-06-04 15:20:30 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
Comment 1 Tim-Philipp Müller 2009-06-04 15:27:44 UTC
Could you provide more details? GLib should be defining 'inline' to something appropriate afaik.
Comment 2 Andoni Morales 2009-06-04 16:27:22 UTC
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
Comment 3 Andoni Morales 2009-06-04 18:15:33 UTC
Solved! 

My config.h was undefining inline (previously defined by GLib, I supose):

#ifndef __cplusplus
#undef  inline
#endif


Comment 4 Andoni Morales 2009-06-04 18:26:13 UTC
BTW, this file is under win32/common/config.h and this section should be removed to let GLib how to define inline
Comment 5 Tim-Philipp Müller 2009-06-04 18:55:04 UTC
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).