GNOME Bugzilla – Bug 656402
Don't use the reserved keyword 'interface' (fixes mingw-w64 compilation)
Last modified: 2011-08-28 00:59:01 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 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
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.