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 656402 - Don't use the reserved keyword 'interface' (fixes mingw-w64 compilation)
Don't use the reserved keyword 'interface' (fixes mingw-w64 compilation)
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: Misc
2.35.x
Other Windows
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2011-08-12 14:03 UTC by Erik van Pienbroek
Modified: 2011-08-28 00:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (5.90 KB, patch)
2011-08-12 14:03 UTC, Erik van Pienbroek
committed Details | Review

Description Erik van Pienbroek 2011-08-12 14:03:11 UTC
Created attachment 193696 [details] [review]
Proposed patch

On Win32 environments, the keyword 'interface' is a reserved keyword. Up until now a hack was applied in soup-portability.h to '#undef interface' so that various pieces of libsoup could use that keyword. However, due to a recent change in the mingw-w64 toolchain this #undef causes more breakage while #include'ing other Win32 headers.

As the keyword 'interface' is a reserved keyword on Win32, applications or libraries shouldn't be messing around with that. This patch changes various parts of libsoup where the keyword 'interface' is used as name for variables. These variables have been renamed to 'iface'. Due to this rename, the #undef hack can be dropped and libsoup can be compiled cleanly against the latest mingw-w64 toolchain
Comment 1 Dan Winship 2011-08-12 17:58:06 UTC
Comment on attachment 193696 [details] [review]
Proposed patch

>-#undef interface

Can you add a corresponding #define in the !G_OS_WIN32 case?

  #define interface do not use interface as a variable name, it breaks on Windows

or something. Otherwise I assure you I'll forget and break it in the future :)

gio/gnetworkingprivate.h in glib has the same #undef btw
Comment 2 Dan Winship 2011-08-28 00:57:02 UTC
I pushed the patch as-is; I realized that since soup-portability.h is
a public header, if we did a "#define interface ..." there, it might
break other apps.

Thanks for the patch.