diff --git a/lib/setup.h b/lib/setup.h index 11e137fc2..fe1613c11 100644 --- a/lib/setup.h +++ b/lib/setup.h @@ -166,6 +166,17 @@ defined(HAVE_LIBSSL) && defined(HAVE_LIBCRYPTO) #define WIN32_LEAN_AND_MEAN /* Prevent including in */ #endif +#if (defined(ENABLE_IPV6) || defined(CURLDEBUG)) && defined(_MSC_VER) && \ + (!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0500) +/* + * Needed to pull in the real getaddrinfo() and not the inline version + * in which doesn't support IPv6 (IPv4 only). is + * included from for <= 0x0500 SDKs. + */ +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x0501 +#endif + #include /* required by telnet.c */ #if defined(ENABLE_IPV6) || defined(USE_SSLEAY)