From 8f3c364b4700c8e459269ff00dbe810503038639 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 5 Jan 2006 21:15:09 +0000 Subject: [PATCH] Make sure all socket headers are protected by ifdefs. git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/ossman@399 fefdeb5f-60dc-0310-8127-8f9354f1896f --- configure.ac | 6 +++--- polyp/module-protocol-stub.c | 7 ++++++- polyp/polyplib-context.c | 9 +++++++-- polyp/pstream.c | 3 +++ polyp/socket-client.c | 16 ++++++++++++---- polyp/socket-server.c | 12 +++++++++--- polyp/socket-util.c | 24 ++++++++++++++++++------ polyp/tagstruct.c | 5 ++++- polyp/util.c | 3 +++ 9 files changed, 65 insertions(+), 20 deletions(-) diff --git a/configure.ac b/configure.ac index 2d75332..8200383 100644 --- a/configure.ac +++ b/configure.ac @@ -119,9 +119,9 @@ AM_CONDITIONAL(OS_IS_WIN32, test "x$os_is_win32" = "x1") AC_HEADER_STDC # POSIX -AC_CHECK_HEADERS([glob.h grp.h netdb.h netinet/in.h netinet/tcp.h pwd.h \ - sched.h sys/capability.h sys/resource.h sys/select.h sys/socket.h \ - syslog.h]) +AC_CHECK_HEADERS([arpa/inet.h glob.h grp.h netdb.h netinet/in.h \ + netinet/in_systm.h netinet/ip.h netinet/tcp.h pwd.h sched.h \ + sys/capability.h sys/resource.h sys/select.h sys/socket.h syslog.h]) AC_CHECK_HEADERS([regex.h], [HAVE_REGEX=1], [HAVE_REGEX=0]) AC_CHECK_HEADERS([sys/un.h], [HAVE_AF_UNIX=1], [HAVE_AF_UNIX=0]) diff --git a/polyp/module-protocol-stub.c b/polyp/module-protocol-stub.c index 1569758..0b91c68 100644 --- a/polyp/module-protocol-stub.c +++ b/polyp/module-protocol-stub.c @@ -27,9 +27,14 @@ #include #include #include -#include #include + +#ifdef HAVE_ARPA_INET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif #include "module.h" #include "socket-server.h" diff --git a/polyp/polyplib-context.c b/polyp/polyplib-context.c index f54cabb..f85c5a4 100644 --- a/polyp/polyplib-context.c +++ b/polyp/polyplib-context.c @@ -28,14 +28,19 @@ #include #include #include -#include -#include #include #include #include #include #include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif + #include "polyplib-internal.h" #include "polyplib-context.h" #include "native-common.h" diff --git a/polyp/pstream.c b/polyp/pstream.c index c081c24..a64856d 100644 --- a/polyp/pstream.c +++ b/polyp/pstream.c @@ -27,7 +27,10 @@ #include #include #include + +#ifdef HAVE_NETINET_IN_H #include +#endif #include "pstream.h" #include "queue.h" diff --git a/polyp/socket-client.c b/polyp/socket-client.c index 58bc7e8..0d712fa 100644 --- a/polyp/socket-client.c +++ b/polyp/socket-client.c @@ -31,14 +31,22 @@ #include #include #include -#include -#include -#include -#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif #ifdef HAVE_SYS_UN_H #include #endif +#ifdef HAVE_ARPA_INET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif #ifdef HAVE_LIBASYNCNS #include diff --git a/polyp/socket-server.c b/polyp/socket-server.c index ed86bc2..0cca4ae 100644 --- a/polyp/socket-server.c +++ b/polyp/socket-server.c @@ -28,15 +28,21 @@ #include #include #include -#include #include #include -#include -#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif #ifdef HAVE_SYS_UN_H #include #endif +#ifdef HAVE_ARPA_INET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif #ifdef HAVE_LIBWRAP #include diff --git a/polyp/socket-util.c b/polyp/socket-util.c index eb6b424..60f8d16 100644 --- a/polyp/socket-util.c +++ b/polyp/socket-util.c @@ -31,19 +31,31 @@ #include #include #include -#include #include #include -#include -#include -#include -#include #include -#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif #ifdef HAVE_SYS_UN_H #include #endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_NETINET_IN_SYSTM_H +#include +#endif +#ifdef HAVE_NETINET_IP_H +#include +#endif +#ifdef HAVE_NETINET_TCP_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif #include "socket-util.h" #include "util.h" diff --git a/polyp/tagstruct.c b/polyp/tagstruct.c index a6dad86..a3bd7d9 100644 --- a/polyp/tagstruct.c +++ b/polyp/tagstruct.c @@ -27,9 +27,12 @@ #include #include #include -#include #include +#ifdef HAVE_NETINET_IN_H +#include +#endif + #include "tagstruct.h" #include "xmalloc.h" diff --git a/polyp/util.c b/polyp/util.c index 9e8dc5e..67eaeda 100644 --- a/polyp/util.c +++ b/polyp/util.c @@ -41,7 +41,10 @@ #include #include #include + +#ifdef HAVE_NETDB_H #include +#endif #include -- 2.7.4