]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix mingw-cross build (#1084)
authorFrancesco Chemolli <kinkie@squid-cache.org>
Sun, 10 Jul 2022 21:45:39 +0000 (21:45 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 12 Jul 2022 06:53:15 +0000 (06:53 +0000)
    compat/os/mswindows.h:640: ::inet_pton has not been declared

compat/os/mswindows.h

index a819767d5f2ee23243bdd4a6a0acc2cb62ba71ee..cfc95652d389ef606c210c9e8cb3c339e81c6527 100644 (file)
@@ -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<void*>(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<void*>(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