diff --git a/CMakeLists.txt b/CMakeLists.txt index 4042f001baa2..c0abc284db2d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1266,7 +1266,7 @@ set(HAVE_SA_FAMILY_T ${HAVE_SIZEOF_SA_FAMILY_T}) set(CMAKE_EXTRA_INCLUDE_FILES "") if(WIN32) - set(CMAKE_EXTRA_INCLUDE_FILES "ws2def.h") + set(CMAKE_EXTRA_INCLUDE_FILES "winsock2.h") check_type_size("ADDRESS_FAMILY" SIZEOF_ADDRESS_FAMILY) set(HAVE_ADDRESS_FAMILY ${HAVE_SIZEOF_ADDRESS_FAMILY}) set(CMAKE_EXTRA_INCLUDE_FILES "") diff --git a/configure.ac b/configure.ac index d9b396376d20..d26a183f569d 100644 --- a/configure.ac +++ b/configure.ac @@ -3473,6 +3473,14 @@ AC_CHECK_TYPE(sa_family_t, AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]), AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]), [ +#ifdef HAVE_WINDOWS_H +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +#endif #ifdef HAVE_SYS_SOCKET_H #include #endif