cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Some fixes for cmake build.

From: tetetest tetetest <tetetest_at_rambler.ru>
Date: Tue, 30 Mar 2010 13:25:03 +0400

* Guenter [Tue, 30 Mar 2010 10:48:23 +0200]:
> I'm not a VS expert, but maybe you can look for _WINSOCKAPI_ define?
> IIRC this is defined by both winsock headers (though not sure) ...

I tried that too. I found the following code in curl.h and put it into
curlbuild.h:

#ifdef CURL_PULL_WS32TCPIP_H
#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H))
/* The check above prevents the winsock2 inclusion if winsock.h already
was
   included, since they can't co-exist without problems */
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
#endif

The build still failed. The reason is that socklen_t is NOT defined in
'winsock.h'.
So, if winsock.h is already included, we skip winsock2.h (it's ok), but
then, socklen_t
is not defined and cannot be used verbatim.

Dilemma: socklen_t can only be used when winsock2.h is included. In
turn,
winsock2.h cannot always be included even if it is present in the
system.

--
Best regards.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-03-30