diff options
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | common/network/TcpSocket.cxx | 1 | ||||
-rw-r--r-- | common/os/net.c | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f904b49a..40017c55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,12 +118,13 @@ include(CheckIncludeFiles) include(CheckFunctionExists) include(CheckTypeSize) if(WIN32) - set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h) + set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h ws2tcpip.h) set(CMAKE_REQUIRED_LIBRARIES ws2_32) +else() + set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h) endif() check_function_exists(inet_aton HAVE_INET_ATON) check_function_exists(inet_ntop HAVE_INET_NTOP) -set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h) check_type_size(socklen_t SOCKLEN_T) set(CMAKE_EXTRA_INCLUDE_FILES) diff --git a/common/network/TcpSocket.cxx b/common/network/TcpSocket.cxx index 04e08950..7e115881 100644 --- a/common/network/TcpSocket.cxx +++ b/common/network/TcpSocket.cxx @@ -23,6 +23,7 @@ #ifdef WIN32 //#include <io.h> #include <winsock2.h> +#include <ws2tcpip.h> #define errorNumber WSAGetLastError() #else #define errorNumber errno diff --git a/common/os/net.c b/common/os/net.c index 5c0ac2d3..7bad36c9 100644 --- a/common/os/net.c +++ b/common/os/net.c @@ -25,6 +25,7 @@ #ifdef WIN32 #include <winsock2.h> +#include <ws2tcpip.h> #else #include <sys/socket.h> #include <netinet/in.h> |