summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Makefile.am7
-rw-r--r--src/pulsecore/ipacl.c24
-rw-r--r--src/tests/ipacl-test.c25
3 files changed, 47 insertions, 9 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 4669fbbe..9eb957d5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -228,7 +228,9 @@ get_binary_name_test_CFLAGS = $(AM_CFLAGS)
get_binary_name_test_LDADD = $(AM_LDADD) libpulse.la
get_binary_name_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
-ipacl_test_SOURCES = tests/ipacl-test.c pulsecore/ipacl.c pulsecore/ipacl.h
+ipacl_test_SOURCES = tests/ipacl-test.c \
+ pulsecore/ipacl.c pulsecore/ipacl.h \
+ pulsecore/inet_pton.c pulsecore/inet_pton.h
ipacl_test_CFLAGS = $(AM_CFLAGS)
ipacl_test_LDADD = $(AM_LDADD) libpulsecore.la
ipacl_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
@@ -677,7 +679,8 @@ libsocket_server_la_SOURCES = \
libsocket_server_la_LDFLAGS = -avoid-version
libsocket_server_la_LIBADD = $(AM_LIBADD) libpulsecore.la libiochannel.la libsocket-util.la $(LIBWRAP_LIBS) $(WINSOCK_LIBS)
-libipacl_la_SOURCES = pulsecore/ipacl.h pulsecore/ipacl.c
+libipacl_la_SOURCES = pulsecore/ipacl.h pulsecore/ipacl.c \
+ pulsecore/inet_pton.c pulsecore/inet_pton.h
libipacl_la_LDFLAGS = -avoid-version
libipacl_la_LIBADD = $(AM_LIBADD) libpulsecore.la $(WINSOCK_LIBS)
diff --git a/src/pulsecore/ipacl.c b/src/pulsecore/ipacl.c
index ed5044ef..15b6b3f9 100644
--- a/src/pulsecore/ipacl.c
+++ b/src/pulsecore/ipacl.c
@@ -24,18 +24,36 @@
#endif
#include <sys/types.h>
+#include <sys/types.h>
+#include <string.h>
+
+#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN_SYSTM_H
#include <netinet/in_systm.h>
+#endif
+#ifdef HAVE_NETINET_IP_H
#include <netinet/ip.h>
-#include <sys/types.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
-#include <string.h>
+#endif
+
+#include "winsock.h"
+
+#include <pulse/xmalloc.h>
#include <pulsecore/core-util.h>
#include <pulsecore/llist.h>
#include <pulsecore/log.h>
-#include <pulse/xmalloc.h>
+
+#ifndef HAVE_INET_PTON
+#include "inet_pton.h"
+#endif
#include "ipacl.h"
diff --git a/src/tests/ipacl-test.c b/src/tests/ipacl-test.c
index 8819a6a0..2566b038 100644
--- a/src/tests/ipacl-test.c
+++ b/src/tests/ipacl-test.c
@@ -1,15 +1,32 @@
/* $Id$ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <sys/types.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <assert.h>
+#include <string.h>
+
+#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
+#endif
+#ifdef HAVE_NETINET_IN_SYSTM_H
#include <netinet/in_systm.h>
+#endif
+#ifdef HAVE_NETINET_IP_H
#include <netinet/ip.h>
-#include <stdio.h>
-#include <unistd.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
-#include <assert.h>
-#include <string.h>
+#endif
+
+#include "../pulsecore/winsock.h"
#include <pulsecore/ipacl.h>