cURL / Mailing Lists / curl-library / Single Mail

curl-library

Patch to Fix winsock2.h Issues in multi.h

From: Casey ODonnell <caseyodonnell_at_gmail.com>
Date: Sun, 15 Aug 2004 22:43:16 -0400

I made the following changes to multi.h, which seemed to work fine
compiling (libcurl as well as wxWidgets apps using curl) under MSW, as
well as compiling from wxWidgets with none of the problems that I
previously had (resulting in lots of errors because wxWidgets includes
winsock prior to anywhere I can prevent it from doing it). I based
this off the suggestions of Gisle Vanem in his response to my
questions. This seemed to prevent the multiply defined errors I
mentioned before. (I still made the change in config-win32.h
commenting out the line for:

/* Define if you have the <winsock2.h> header file. */
/* #define HAVE_WINSOCK2_H 1 */

And it still builds correctly regardless of that line being commented out.

Cheers.
Casey

Index: include/curl/multi.h
===================================================================
RCS file: /cvsroot/curl/curl/include/curl/multi.h,v
retrieving revision 1.18
diff -u -r1.18 multi.h
--- include/curl/multi.h 24 Mar 2004 22:53:42 -0000 1.18
+++ include/curl/multi.h 16 Aug 2004 01:34:02 -0000
@@ -52,7 +52,9 @@
 #endif
 
 #if defined(WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
+#if !defined(_WINSOCKAPI_) && !defined(_WINSOCK_H)
 #include <winsock2.h>
+#endif
 #else
 
 /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish

-- 
Casey O'Donnell
RPI STS Department - Graduate Student
http://homepage.mac.com/codonnell/
http://homepage.mac.com/codonnell/wxblogger/
Received on 2004-08-16