From 8fe9376d542ef4f11b2049190de363f7b79436ec Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 4 Apr 2007 06:06:36 +0000 Subject: [PATCH] move WinSock definitions of EBADF, EINTR, EINVAL and EAFNOSUPPORT to setup_once.h --- ares/setup_once.h | 6 ++++++ lib/inet_pton.c | 4 ---- lib/select.c | 11 ----------- lib/setup_once.h | 6 ++++++ 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/ares/setup_once.h b/ares/setup_once.h index 6911f1bcf..083fdbc4f 100644 --- a/ares/setup_once.h +++ b/ares/setup_once.h @@ -276,6 +276,12 @@ typedef int sig_atomic_t; */ #ifdef USE_WINSOCK +#undef EBADF /* override definition in errno.h */ +#define EBADF WSAEBADF +#undef EINTR /* override definition in errno.h */ +#define EINTR WSAEINTR +#undef EINVAL /* override definition in errno.h */ +#define EINVAL WSAEINVAL #define EWOULDBLOCK WSAEWOULDBLOCK #define EINPROGRESS WSAEINPROGRESS #define EALREADY WSAEALREADY diff --git a/lib/inet_pton.c b/lib/inet_pton.c index 192d0624a..fb7feef28 100644 --- a/lib/inet_pton.c +++ b/lib/inet_pton.c @@ -41,10 +41,6 @@ #define INADDRSZ 4 #define INT16SZ 2 -#ifdef USE_WINSOCK -#define EAFNOSUPPORT WSAEAFNOSUPPORT -#endif - /* * WARNING: Don't even consider trying to compile this on a system where * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. diff --git a/lib/select.c b/lib/select.c index ddc40593e..2af14eb36 100644 --- a/lib/select.c +++ b/lib/select.c @@ -23,8 +23,6 @@ #include "setup.h" -#include - #ifdef HAVE_SYS_SELECT_H #include #endif @@ -51,15 +49,6 @@ #include "connect.h" #include "select.h" -#ifdef USE_WINSOCK -# undef EBADF -# define EBADF WSAEBADF -# undef EINTR -# define EINTR WSAEINTR -# undef EINVAL -# define EINVAL WSAEINVAL -#endif - /* Winsock and TPF sockets are not in range [0..FD_SETSIZE-1] */ #if defined(USE_WINSOCK) || defined(TPF) diff --git a/lib/setup_once.h b/lib/setup_once.h index 79324d40f..03141a4ff 100644 --- a/lib/setup_once.h +++ b/lib/setup_once.h @@ -283,6 +283,12 @@ typedef int sig_atomic_t; */ #ifdef USE_WINSOCK +#undef EBADF /* override definition in errno.h */ +#define EBADF WSAEBADF +#undef EINTR /* override definition in errno.h */ +#define EINTR WSAEINTR +#undef EINVAL /* override definition in errno.h */ +#define EINVAL WSAEINVAL #define EWOULDBLOCK WSAEWOULDBLOCK #define EINPROGRESS WSAEINPROGRESS #define EALREADY WSAEALREADY