summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/arpa-inet.h
diff options
context:
space:
mode:
authorMaarten Bosmans <mkbosmans@gmail.com>2011-03-01 16:06:19 +0100
committerMaarten Bosmans <mkbosmans@gmail.com>2011-03-19 13:41:05 +0100
commitc470680e1ba008c05c13231dbbafd69cb9330488 (patch)
tree1ec2b34d830ac69829f46d3b316a661345ee62ce /src/pulsecore/arpa-inet.h
parent09d7baec645c8720b9ba71fc1e8db6b35c3da943 (diff)
Use pulsecore/arpa-inet.h to make arpa/inet.h functionality available
Automatically use replacement function on platforms (win32) where not all arpa/inet.h is available natively.
Diffstat (limited to 'src/pulsecore/arpa-inet.h')
-rw-r--r--src/pulsecore/arpa-inet.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/pulsecore/arpa-inet.h b/src/pulsecore/arpa-inet.h
new file mode 100644
index 00000000..303c905b
--- /dev/null
+++ b/src/pulsecore/arpa-inet.h
@@ -0,0 +1,23 @@
+#ifndef fooarpa_inethfoo
+#define fooarpa_inethfoo
+
+
+#if defined(HAVE_ARPA_INET_H)
+
+#include <arpa/inet.h>
+
+#elif defined(OS_IS_WIN32)
+
+/* On Windows winsock2.h (here included via pulsecore/socket.h) provides most of the functionality of arpa/inet.h, except for
+ * the inet_ntop and inet_pton functions, which are implemented here. */
+
+#include <pulsecore/socket.h>
+
+const char *inet_ntop(int af, const void *src, char *dst, socklen_t cnt);
+
+int inet_pton(int af, const char *src, void *dst);
+
+#endif
+
+
+#endif