]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - compat/os/mswindows.h
Source Format Enforcement (#532)
[thirdparty/squid.git] / compat / os / mswindows.h
index 0f31a2d52a7215982361b790b485d105fd535a92..008aa781e482488f8cc9841eac0654c3cdd43359 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -358,6 +358,9 @@ typedef char * caddr_t;
 #ifndef ENOTSUP
 #define ENOTSUP WSAEOPNOTSUPP
 #endif
+#ifndef ECONNABORTED
+#define ECONNABORTED WSAECONNABORTED
+#endif
 
 #undef h_errno
 #define h_errno errno /* we'll set it ourselves */
@@ -624,10 +627,25 @@ getsockopt(int s, int l, int o, void * v, socklen_t * n)
 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
+    return ::inet_ntop(af, src, dst, size);
+#endif
 }
 #define inet_ntop(a,s,d,l) Squid::inet_ntop(a,s,d,l)
 
+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
+    return ::inet_pton(af, src, dst);
+#endif
+}
+#define inet_pton(a,s,d) Squid::inet_pton(a,s,d)
+
 /* Simple ioctl() emulation */
 inline int
 ioctl(int s, int c, void * a)