aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-03-26 13:47:46 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-03-26 13:47:46 +0000
commit843391c74550930b176b15b7dbde588564b84879 (patch)
treed6cbe48da3c67820067b42247d75b26e5044284a
parentad6699e0c43b8c1495db54652d96cad7e2f800aa (diff)
Gisle Vanem:
A patch to bypass MS' sillyness with regard to IPv6 and getaddrinfo(). The CURLDEBUG part is to avoid redefinition warning caused by memdebug.h. If ENABLE_IPV6 isn't enabled, it doesn't matter since we never call getaddrinfo(). Allthough we could to support weird protocols like SOCK_RDM that Win-2K/XP has.
-rw-r--r--lib/setup.h11
1 files changed, 11 insertions, 0 deletions
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 <winsock*.h> in <windows.h> */
#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 <wspiAPI.H> which doesn't support IPv6 (IPv4 only). <wspiAPI.H> is
+ * included from <ws2tcpip.h> for <= 0x0500 SDKs.
+ */
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0501
+#endif
+
#include <winsock2.h> /* required by telnet.c */
#if defined(ENABLE_IPV6) || defined(USE_SSLEAY)