mirror of
https://github.com/curl/curl.git
synced 2026-08-25 01:03:31 +03:00
Provide a socklen_t definition in curl.h for Win32 API build targets
which don't have one.
This commit is contained in:
parent
4bd2d49ca1
commit
d789097af0
3 changed files with 22 additions and 0 deletions
|
|
@ -85,6 +85,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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue