From: Francois Gouget Subject: [PATCH] wininet: Include winsock2.h before stdlib.h. Message-Id: Date: Wed, 2 Oct 2019 12:33:32 +0200 (CEST) Otherwise winsock2.h's fd_set macros break which is included by on NetBSD. Moving winsock2.h after all system includes may work too because http.c does not (currently) use any of the fd_set APIs. But it seems like there would be a higher risk of mixing Unix socket types from the Unix headers with the Windows ones. So include winsock2.h first as recommended, but then _WIN32 is defined which causes zlib.h to use FAR which is not allowed in Wine code. So carve out an exception for it. Signed-off-by: Francois Gouget --- Resubmitting... dlls/wininet/http.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index fc412849eb5..949a6afc9c6 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -29,15 +29,19 @@ #include "config.h" +#include "winsock2.h" +#include "ws2ipdef.h" + #include #ifdef HAVE_ZLIB +# undef FAR +# define FAR # include +# undef FAR +# define FAR __ONLY_IN_WINELIB(/* nothing */) #endif -#include "winsock2.h" -#include "ws2ipdef.h" - #include #include #include -- 2.20.1