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>
The test uses an erroneous non-directive within #ifdef _WIN32 to
signal that _WIN32 is defined. Some compilers choke on this even when
_WIN32 isn't defined. Observed with FreeBSD 4.10's gcc 2.95.4.
Broken in commit c02468fd, v4.3.22. Standaline client build already
broken in commit 774b590f, v4.3.17.
Use an unmatched brace instead.
Checking Windows libraries with autoconf is cumbersome, because
linking often fails unless you include the header, and AC_SEARCH_LIBS
doesn't permit that.
Just detect the Windows API instead, with new MY_WINDOWS_API.