[vlc-devel] [3.0 PATCH] configure: Include windows.h before checking the _WIN32_WINNT version

Martin Storsjö martin at martin.st
Thu Apr 9 00:05:57 CEST 2020


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.

(cherry picked from commit 22fed9624f2ce7e3db5b5516a819c147ac1d13d4)
---
Another cherrypick on the same topic/area.
---
 configure.ac | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 73bddc6b5b..a7dc06ae7a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -683,10 +683,11 @@ LIBS="${LIBS} ${SOCKET_LIBS}"
 CFLAGS="${CFLAGS} -Werror-implicit-function-declaration"
 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>
-- 
2.17.1



More information about the vlc-devel mailing list