[PATCH] wininet: Include winsock2.h before stdlib.h.

Alexandre Julliard julliard at winehq.org
Wed Oct 2 08:57:23 CDT 2019


Jacek Caban <jacek at codeweavers.com> writes:

> Hi Francois,
>
>
> On 02/10/2019 12:33, Francois Gouget wrote:
>> Otherwise winsock2.h's fd_set macros break <sys/select.h> which is
>> included by <time.h> 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.
>
>
> Using FAR by host zlib.h is worrying. Ideally, we'd move wininet to PE
> file and not have to deal with it. zlib is one of the reasons it's not
> done yet (using host APIs for proxy settings is the other
> reason). Maybe we should import zlib to Wine and build it against
> msvcrt?

Yes, building as PE would be better. zlib should be fairly easy to fix,
but I haven't done it yet because it wouldn't help without also fixing
the proxy settings thing. Anybody wants to have a look at that one?

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list