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>