Summary: |
winsock.h header gymnastics don't work on MinGW |
Product: |
dbus
|
Reporter: |
Matt Fischer <matt.fischer> |
Component: |
core | Assignee: |
Havoc Pennington <hp> |
Status: |
RESOLVED
FIXED
|
QA Contact: |
|
Severity: |
normal
|
|
|
Priority: |
medium
|
CC: |
ralf.habacker
|
Version: |
unspecified | Keywords: |
patch |
Hardware: |
All | |
|
OS: |
Windows (All) | |
|
Whiteboard: |
basically review+, needs Windows ack |
i915 platform:
|
|
i915 features:
|
|
Attachments: |
Define WIN32_LEAN_AND_MEAN in Windows port
|
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.
Created attachment 88911 [details] Define WIN32_LEAN_AND_MEAN in Windows port The windows sysdep file is using a somewhat dodgy mechanism to prevent windows.h from automatically including winsock.h--it's trying to define the header guard macro for winsock.h, to trick the compiler into not including it. This is causing me problems on MinGW because its version of winsock.h uses a different guard macro name. From reading around online, it appears that defining WIN32_LEAN_AND_MEAN will also serve to prevent winsock.h from being included. That's less brittle, since it's actually a defined piece of windows.h's API, instead of an implementation detail of one of its headers. Replacing the header guard definition with that seems to work correctly for me on MinGW32 4.0.3, although I am not able to test it with any other Windows toolchain at the moment. Is this an OK change to make, or is there some other reason that the guard macro approach had been used?