MSVC fix for 'socklen_t'. Replace <winsock.h> with <winsock2.h> +
authorGisle Vanem <gvanem@broadpark.no>
Wed, 9 Nov 2005 21:38:58 +0000 (21:38 +0000)
committerGisle Vanem <gvanem@broadpark.no>
Wed, 9 Nov 2005 21:38:58 +0000 (21:38 +0000)
<ws2tcpip.h> since IPv6 is no longer optional (was it ever?)

setup.h

diff --git a/setup.h b/setup.h
index 619a285d2bda9406aacfb934490355b5b98a299b..d6e0378120df12f9d019b0965cdc5361f751c93e 100644 (file)
--- a/setup.h
+++ b/setup.h
 #else
 /* simple work-around for now, for systems without configure support */
 #define ssize_t int
+#ifndef _MSC_VER
 #define socklen_t int
 #endif
+#endif
 
 /* Recent autoconf versions define these symbols in config.h. We don't want
    them (since they collide with the libcurl ones when we build
@@ -35,7 +37,8 @@
 
 /* now typedef our socket type */
 #if defined(WIN32) && !defined(WATT32)
-#include <winsock.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
 typedef SOCKET ares_socket_t;
 #define ARES_SOCKET_BAD INVALID_SOCKET
 #else