]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - compat/os/mswindows.h
SourceFormat Enforcement
[thirdparty/squid.git] / compat / os / mswindows.h
index 1d3e6eb2fe08e362d7cf760f866136775973fa5b..8996808f72c41d23c9f0483322e9f0d51ec63227 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -621,6 +621,28 @@ 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)
 
+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)