From 3cc5194cbbbcace098d8a6ce4ef693e0ce0c26fd Mon Sep 17 00:00:00 2001 From: Francesco Chemolli Date: Sun, 10 Jul 2022 21:45:39 +0000 Subject: [PATCH] Fix mingw-cross build (#1084) compat/os/mswindows.h:640: ::inet_pton has not been declared --- compat/os/mswindows.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compat/os/mswindows.h b/compat/os/mswindows.h index a819767d5f..cfc95652d3 100644 --- a/compat/os/mswindows.h +++ b/compat/os/mswindows.h @@ -618,27 +618,31 @@ getsockopt(int s, int l, int o, void * v, socklen_t * n) } #define getsockopt(s,l,o,v,n) Squid::getsockopt(s,l,o,v,n) +#if HAVE_DECL_INETNTOPA || HAVE_DECL_INET_NTOP inline char * inet_ntop(int af, const void *src, char *dst, size_t size) { #if HAVE_DECL_INETNTOPA return (char*)InetNtopA(af, const_cast(src), dst, size); -#else +#else // HAVE_DECL_INET_NTOP return ::inet_ntop(af, src, dst, size); #endif } #define inet_ntop(a,s,d,l) Squid::inet_ntop(a,s,d,l) +#endif // let compat/inet_ntop.h deal with it +#if HAVE_DECL_INETPTONA || HAVE_DECL_INET_PTON inline char * inet_pton(int af, const void *src, char *dst) { #if HAVE_DECL_INETPTONA return (char*)InetPtonA(af, const_cast(src), dst); -#else +#else // HAVE_DECL_INET_PTON return ::inet_pton(af, src, dst); #endif } #define inet_pton(a,s,d) Squid::inet_pton(a,s,d) +#endif // let compat/inet_pton.h deal with it /* Simple ioctl() emulation */ inline int -- 2.47.2