Skip to content

Commit

Permalink
Include windows.h before checking the _WIN32_WINNT version
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mstorsjo authored and jbkempf committed Feb 27, 2018
1 parent 4c45d12 commit 0a65bf3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,11 @@ LIBS_SAVE=${LIBS}
LIBS="${LIBS} ${LIBSOCKET}"
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>
Expand All @@ -233,10 +234,11 @@ AC_LINK_IFELSE([
AC_LINK_IFELSE([
AC_LANG_PROGRAM([#include <stddef.h>
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
# if _WIN32_WINNT < 0x600
# error Needs vista+
# endif
#include <winsock2.h>
#else
#include <poll.h>
#endif], [
Expand Down

0 comments on commit 0a65bf3

Please sign in to comment.