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 738551 - 'interface' variable conflicts with Windows defines
'interface' variable conflicts with Windows defines
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: Misc
2.48.x
Other Linux
: Normal normal
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2014-10-14 22:54 UTC by Kalev Lember
Modified: 2014-11-02 14:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix build on Windows (1.03 KB, patch)
2014-10-14 22:55 UTC, Kalev Lember
committed Details | Review

Description Kalev Lember 2014-10-14 22:54:15 UTC
Windows headers do "#define interface struct" which causes a conflict with the 'interface' variable name:

In file included from /usr/i686-w64-mingw32/sys-root/mingw/include/urlmon.h:7:0,
                 from /usr/i686-w64-mingw32/sys-root/mingw/include/ocidl.h:226,
                 from /usr/i686-w64-mingw32/sys-root/mingw/include/naptypes.h:23,
                 from /usr/i686-w64-mingw32/sys-root/mingw/include/ras.h:17,
                 from /usr/i686-w64-mingw32/sys-root/mingw/include/mprapi.h:10,
                 from /usr/i686-w64-mingw32/sys-root/mingw/include/iprtrmib.h:9,
                 from /usr/i686-w64-mingw32/sys-root/mingw/include/iphlpapi.h:13,
                 from /usr/i686-w64-mingw32/sys-root/mingw/include/glib-2.0/gio/gnetworking.h:35,
                 from ../../libsoup/soup-address.c:14:
../../libsoup/soup-server.h:83:40: error: expected ';', ',' or ')' before 'struct'
              GSocketAddress           *interface,
                                        ^
Makefile:870: recipe for target 'soup-address.lo' failed
Comment 1 Kalev Lember 2014-10-14 22:55:23 UTC
Created attachment 288555 [details] [review]
Fix build on Windows

Avoid the use of 'interface' variable name in public headers to avoid
conflicting with the "#define interface struct" that Windows headers do.
Comment 2 Dan Winship 2014-10-15 12:36:27 UTC
See also bug 656402, bug 696509, bug 692134

This was supposed to have been fixed by having "#undef interface" in gnetworking.h, but it appears to have gotten broken again with the addition of "include <iphlpapi.h>" last year. Does it break anything (anywhere in the stack) if you move the #undef to after that include?
Comment 3 Kalev Lember 2014-10-15 12:49:39 UTC
Not sure -- in any case, renaming the GSocketAddress parameter in the .h file makes sense regardless of adding the #undef since it's called 'address' in the .c file and in the documentation there.
Comment 4 Dan Winship 2014-10-19 13:14:52 UTC
Comment on attachment 288555 [details] [review]
Fix build on Windows

ok, but don't close the bug. I want it around to remind me to fix gnetworking.h
Comment 5 Kalev Lember 2014-10-20 13:14:57 UTC
Comment on attachment 288555 [details] [review]
Fix build on Windows

Attachment 288555 [details] pushed as a9c26b0 - Fix build on Windows
Comment 6 Dan Winship 2014-11-02 14:38:43 UTC
ok, fixed this in glib too. It still builds fine under mingw, so let's see if anyone complains about it breaking anything else...
Comment 7 Kalev Lember 2014-11-02 14:41:28 UTC
Thanks Dan!