diff options
author | Yang Tse <yangsita@gmail.com> | 2007-11-22 16:35:07 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2007-11-22 16:35:07 +0000 |
commit | d789097af0e1f9801ad3eaca5ff6445ce888859f (patch) | |
tree | ad31c4556875c185d8822c796635a076513655e8 /include | |
parent | 4bd2d49ca1d92ca5cd90ce91af97e389a410c973 (diff) | |
download | curl-d789097af0e1f9801ad3eaca5ff6445ce888859f.tar.gz |
Provide a socklen_t definition in curl.h for Win32 API build targets
which don't have one.
Diffstat (limited to 'include')
-rw-r--r-- | include/curl/curl.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/curl/curl.h b/include/curl/curl.h index 79ea49752..83028928a 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -86,6 +86,23 @@ extern "C" { typedef void CURL; /* + * Windows build targets have socklen_t definition in + * ws2tcpip.h but some versions of ws2tcpip.h do not + * have the definition. It seems that when the socklen_t + * definition is missing from ws2tcpip.h the definition + * for INET_ADDRSTRLEN is also missing, and that when one + * definition is present the other one also is available. + */ + +#if defined(WIN32) && !defined(HAVE_SOCKLEN_T) +# if ( defined(_MSC_VER) && !defined(INET_ADDRSTRLEN) ) || \ + (!defined(_MSC_VER) && !defined(_WS2TCPIP_H_) && !defined(_WS2TCPIP_H) ) +# define socklen_t int +# define HAVE_SOCKLEN_T +# endif +#endif + +/* * Decorate exportable functions for Win32 DLL linking. * This avoids using a .def file for building libcurl.dll. */ |