]> git.pond.sub.org Git - empserver/commit
w32: Modernize for MinGW 6.0.0, and clean up
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 27 Jan 2021 07:20:05 +0000 (08:20 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 13 Feb 2021 18:25:18 +0000 (19:25 +0100)
commita164390d1fffb43a0bf5a321a2ea03e92ed6cdeb
treede097e0951e093161ae69d88ed878a519fe62509
parent598669673e8b08a8bdc763a54da3808f2307cf27
w32: Modernize for MinGW 6.0.0, and clean up

We provide gettimeofday() only #ifdef _MSC_VER, but declare it
unconditionally in our own sys/time.h.  This is asking for trouble.
Declare it only #ifdef _MSC_VER, else pull in MinGW's sys/time.h with
#include_next.

Likewise, define macros ftruncate(), S_IRUSR & friends in our own
unistd.h only #ifdef _MSC_VER, else pull in MinGW's unistd.h with
#include_next.  The #include <getopt.h> is now useless, drop.

src/lib/commands/info.c relies on sys/time.h including windows.h.
Unclean, and no longer the case with MinGW.  Include it directly.

MinGW provides EWOULDBLOCK.  Drop our replacement.

MinGW provides inet_ntop() in ws2tcpip.h, but only if feature test
macro _WIN32_WINNT >= 0x600, i.e. Windows Vista or later.  It defaults
to 0x0502 (Windows Server 2003).  Make configure #define _WIN32_WINNT
0x0601 in config.h.  This requests Windows 7.  Trying to support Vista
feels unwise.  Include ws2tcpip.h, and drop our replacement.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
m4/my_windows_api.m4
src/lib/commands/info.c
src/lib/w32/arpa/inet.h
src/lib/w32/getrusage.c
src/lib/w32/sys/time.h
src/lib/w32/unistd.h
src/lib/w32/w32misc.h
src/lib/w32/w32sockets.c