diff options
author | Pierre Ossman <ossman@cendio.se> | 2006-01-09 16:50:39 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2006-01-09 16:50:39 +0000 |
commit | 5fcbf04f5b95cccc61b2986a6582fa475e4d9c8b (patch) | |
tree | 28c2020661b53c47e8a490199b0f115acd881f05 | |
parent | 9818d67ec27bbc39feaf4c1a1f3d35a029484cc9 (diff) |
Condense winsock includes and defines into one header.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/ossman@428 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r-- | polyp/Makefile.am | 2 | ||||
-rw-r--r-- | polyp/iochannel.c | 4 | ||||
-rw-r--r-- | polyp/main.c | 6 | ||||
-rw-r--r-- | polyp/mainloop.c | 4 | ||||
-rw-r--r-- | polyp/module-protocol-stub.c | 7 | ||||
-rw-r--r-- | polyp/poll.c | 11 | ||||
-rw-r--r-- | polyp/polyplib-context.c | 7 | ||||
-rw-r--r-- | polyp/pstream.c | 4 | ||||
-rw-r--r-- | polyp/socket-client.c | 11 | ||||
-rw-r--r-- | polyp/socket-server.c | 9 | ||||
-rw-r--r-- | polyp/socket-util.c | 5 | ||||
-rw-r--r-- | polyp/tagstruct.c | 4 | ||||
-rw-r--r-- | polyp/util.c | 9 | ||||
-rw-r--r-- | polyp/winsock.h | 23 |
14 files changed, 41 insertions, 65 deletions
diff --git a/polyp/Makefile.am b/polyp/Makefile.am index 5f57142a..ab7dfe5b 100644 --- a/polyp/Makefile.am +++ b/polyp/Makefile.am @@ -335,6 +335,7 @@ libpolyp_@PA_MAJORMINOR@_la_SOURCES = \ tagstruct.c tagstruct.h \ typeid.c typeid.h \ util.c util.h \ + winsock.h \ xmalloc.c xmalloc.h if HAVE_X11 @@ -476,6 +477,7 @@ libpolypcore_la_SOURCES = \ tokenizer.c tokenizer.h \ typeid.c typeid.h \ util.c util.h \ + winsock.h \ xmalloc.c xmalloc.h libpolypcore_la_CPPFLAGS = $(AM_CPPFLAGS) diff --git a/polyp/iochannel.c b/polyp/iochannel.c index 08a4e362..1a0dbf91 100644 --- a/polyp/iochannel.c +++ b/polyp/iochannel.c @@ -28,9 +28,7 @@ #include <fcntl.h> #include <unistd.h> -#ifdef HAVE_WINSOCK2_H -#include <winsock2.h> -#endif +#include "winsock.h" #include "iochannel.h" #include "util.h" diff --git a/polyp/main.c b/polyp/main.c index 437f0a41..e481fce1 100644 --- a/polyp/main.c +++ b/polyp/main.c @@ -42,15 +42,13 @@ #include <sys/ioctl.h> #endif -#ifdef HAVE_WINSOCK2_H -#include <winsock2.h> -#endif - #ifdef HAVE_LIBWRAP #include <syslog.h> #include <tcpd.h> #endif +#include "winsock.h" + #include "core.h" #include "mainloop.h" #include "module.h" diff --git a/polyp/mainloop.c b/polyp/mainloop.c index 9cfd5397..ada74afc 100644 --- a/polyp/mainloop.c +++ b/polyp/mainloop.c @@ -38,9 +38,7 @@ #include "poll.h" #endif -#ifdef HAVE_WINSOCK2_H -#include <winsock2.h> -#endif +#include "winsock.h" #include "mainloop.h" #include "util.h" diff --git a/polyp/module-protocol-stub.c b/polyp/module-protocol-stub.c index 8c06a610..141eadd3 100644 --- a/polyp/module-protocol-stub.c +++ b/polyp/module-protocol-stub.c @@ -40,12 +40,7 @@ #include <netinet/in.h> #endif -#ifdef HAVE_WINSOCK2_H -#include <winsock2.h> -#endif -#ifdef HAVE_WS2TCPIP_H -#include <ws2tcpip.h> -#endif +#include "winsock.h" #include "module.h" #include "socket-server.h" diff --git a/polyp/poll.c b/polyp/poll.c index 7c25f348..cb7e3e7a 100644 --- a/polyp/poll.c +++ b/polyp/poll.c @@ -36,16 +36,7 @@ #include <sys/select.h> #endif -#ifdef HAVE_WINSOCK2_H -#include <winsock2.h> - -#define EBADF WSAEBADF -#define ESHUTDOWN WSAESHUTDOWN -#define ECONNRESET WSAECONNRESET -#define ECONNABORTED WSAECONNABORTED -#define ENETRESET WSAENETRESET - -#endif /* HAVE_WINSOCK2_H */ +#include "winsock.h" #ifndef HAVE_SYS_POLL_H diff --git a/polyp/polyplib-context.c b/polyp/polyplib-context.c index da91995b..f97d9b82 100644 --- a/polyp/polyplib-context.c +++ b/polyp/polyplib-context.c @@ -45,12 +45,7 @@ #include <netdb.h> #endif -#ifdef HAVE_WINSOCK2_H -#include <winsock2.h> -#define ETIMEDOUT WSAETIMEDOUT -#define ECONNREFUSED WSAECONNREFUSED -#define EHOSTUNREACH WSAEHOSTUNREACH -#endif +#include "winsock.h" #include "polyplib-internal.h" #include "polyplib-context.h" diff --git a/polyp/pstream.c b/polyp/pstream.c index 607b0c1a..6f983289 100644 --- a/polyp/pstream.c +++ b/polyp/pstream.c @@ -32,9 +32,7 @@ #include <netinet/in.h> #endif -#ifdef HAVE_WINSOCK2_H -#include <winsock2.h> -#endif +#include "winsock.h" #include "pstream.h" #include "queue.h" diff --git a/polyp/socket-client.c b/polyp/socket-client.c index 6d8cb2ab..51134b84 100644 --- a/polyp/socket-client.c +++ b/polyp/socket-client.c @@ -48,19 +48,12 @@ #include <netdb.h> #endif -#ifdef HAVE_WINSOCK2_H -#include <winsock2.h> -#define EINPROGRESS WSAEINPROGRESS -#define ETIMEDOUT WSAETIMEDOUT -#endif -#ifdef HAVE_WS2TCPIP_H -#include <ws2tcpip.h> -#endif - #ifdef HAVE_LIBASYNCNS #include <asyncns.h> #endif +#include "winsock.h" + #include "socket-client.h" #include "socket-util.h" #include "util.h" diff --git a/polyp/socket-server.c b/polyp/socket-server.c index c27979da..18122f33 100644 --- a/polyp/socket-server.c +++ b/polyp/socket-server.c @@ -48,17 +48,12 @@ #include <netinet/in.h> #endif -#ifdef HAVE_WINSOCK2_H -#include <winsock2.h> -#endif -#ifdef HAVE_WS2TCPIP_H -#include <ws2tcpip.h> -#endif - #ifdef HAVE_LIBWRAP #include <tcpd.h> #endif +#include "winsock.h" + #include "socket-server.h" #include "socket-util.h" #include "xmalloc.h" diff --git a/polyp/socket-util.c b/polyp/socket-util.c index 699b28c2..381502b5 100644 --- a/polyp/socket-util.c +++ b/polyp/socket-util.c @@ -57,10 +57,7 @@ #include <netdb.h> #endif -#ifdef HAVE_WINSOCK2_H -#include <winsock2.h> -#define ETIMEDOUT WSAETIMEDOUT -#endif +#include "winsock.h" #include "socket-util.h" #include "util.h" diff --git a/polyp/tagstruct.c b/polyp/tagstruct.c index ff444e36..1e44f8ef 100644 --- a/polyp/tagstruct.c +++ b/polyp/tagstruct.c @@ -33,9 +33,7 @@ #include <netinet/in.h> #endif -#ifdef HAVE_WINSOCK2_H -#include <winsock2.h> -#endif +#include "winsock.h" #include "tagstruct.h" #include "xmalloc.h" diff --git a/polyp/util.c b/polyp/util.c index ff27430a..f1f4b2c5 100644 --- a/polyp/util.c +++ b/polyp/util.c @@ -59,13 +59,6 @@ #include <windows.h> #endif -#ifdef HAVE_WINSOCK2_H -#include <winsock2.h> -#endif -#ifdef HAVE_WS2TCPIP_H -#include <ws2tcpip.h> -#endif - #include <samplerate.h> #ifdef HAVE_PWD_H @@ -75,6 +68,8 @@ #include <grp.h> #endif +#include "winsock.h" + #include "util.h" #include "xmalloc.h" #include "log.h" diff --git a/polyp/winsock.h b/polyp/winsock.h new file mode 100644 index 00000000..60fac87d --- /dev/null +++ b/polyp/winsock.h @@ -0,0 +1,23 @@ +#ifndef foowinsockhfoo +#define foowinsockhfoo + +#ifdef HAVE_WINSOCK2_H +#include <winsock2.h> + +#define EBADF WSAEBADF +#define ESHUTDOWN WSAESHUTDOWN +#define ECONNRESET WSAECONNRESET +#define ECONNABORTED WSAECONNABORTED +#define ENETRESET WSAENETRESET +#define EINPROGRESS WSAEINPROGRESS +#define ETIMEDOUT WSAETIMEDOUT +#define ECONNREFUSED WSAECONNREFUSED +#define EHOSTUNREACH WSAEHOSTUNREACH + +#endif + +#ifdef HAVE_WS2TCPIP_H +#include <ws2tcpip.h> +#endif + +#endif |