configure: Include windows.h before checking the _WIN32_WINNT version
authorMartin Storsjö <martin@martin.st>
Thu, 14 Dec 2017 21:06:32 +0000 (23:06 +0200)
committerMartin Storsjö <martin@martin.st>
Mon, 26 Feb 2018 10:51:06 +0000 (12:51 +0200)
The default value of _WIN32_WINNT isn't something that is built into
the compiler, but is defined by the toolchain headers.

Include windows.h after including ws2tcpip.h/winsock2.h, since those
headers should be included in that particular order.

configure.ac

index 62af699..4184012 100644 (file)
@@ -665,10 +665,11 @@ AC_SEARCH_LIBS([inet_pton], [nsl], [
 LIBS="${LIBS} ${SOCKET_LIBS}"
 AC_LINK_IFELSE([
     AC_LANG_PROGRAM([#ifdef _WIN32
+        #include <ws2tcpip.h>
+        #include <windows.h>
         # if _WIN32_WINNT < 0x600
         #  error Needs vista+
         # endif
-        #include <ws2tcpip.h>
         #else
         #include <sys/socket.h>
         #include <arpa/inet.h>