mirror of
https://github.com/curl/curl.git
synced 2026-07-31 01:58:13 +03:00
msvc: fix building with HAVE_INET_NTOP and MSVC <=1900
MSVC 1900 and older is missing a `const` specifier in the `inet_ntop()` declaration for the second argument. A workaround was in place for it in cmake, but it didn't cover all necessary versions. Replace the workaround with a different one, move it to `lib/inet_ntop.c` and extend to all necessary MSVC versions. Also add CI jobs for the older MSVC versions: 2013, 2015, 2017. Closes #15923
This commit is contained in:
parent
4e6de2f43f
commit
08ff33e483
3 changed files with 38 additions and 5 deletions
|
|
@ -33,8 +33,11 @@ char *Curl_inet_ntop(int af, const void *addr, char *buf, size_t size);
|
|||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
#define Curl_inet_ntop(af,addr,buf,size) \
|
||||
inet_ntop(af, addr, buf, size)
|
||||
#if defined(_MSC_VER) && (_MSC_VER <= 1900)
|
||||
#define Curl_inet_ntop(af,addr,buf,size) inet_ntop(af, (void *)addr, buf, size)
|
||||
#else
|
||||
#define Curl_inet_ntop(af,addr,buf,size) inet_ntop(af, addr, buf, size)
|
||||
#endif
|
||||
#elif defined(__AMIGA__)
|
||||
#define Curl_inet_ntop(af,addr,buf,size) \
|
||||
(char *)inet_ntop(af, (void *)addr, (unsigned char *)buf, \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue