From d9bf55570b4abbe9ed0058091d567e99ebff0973 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Sat, 17 Feb 2007 13:51:24 +0000 Subject: Move portable error number symbolic name definitions to setup_once.h --- ares/nameser.h | 5 ----- ares/setup_once.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ lib/connect.c | 8 -------- lib/inet_ntop.c | 4 ---- lib/setup_once.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ tests/server/util.h | 6 ------ 6 files changed, 90 insertions(+), 23 deletions(-) diff --git a/ares/nameser.h b/ares/nameser.h index a7587d002..ec5e77aa0 100644 --- a/ares/nameser.h +++ b/ares/nameser.h @@ -18,11 +18,6 @@ #define MAXHOSTNAMELEN 256 -#define EINPROGRESS WSAEINPROGRESS -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EMSGSIZE WSAEMSGSIZE -#define EAFNOSUPPORT WSAEAFNOSUPPORT - /* Structure for scatter/gather I/O. */ struct iovec { diff --git a/ares/setup_once.h b/ares/setup_once.h index 25eacf51e..6daf9d8b7 100644 --- a/ares/setup_once.h +++ b/ares/setup_once.h @@ -186,5 +186,50 @@ typedef int sig_atomic_t; #endif +/* + * Portable error number symbolic names defined to Winsock error codes. + */ + +#ifdef USE_WINSOCK +#define EWOULDBLOCK WSAEWOULDBLOCK +#define EINPROGRESS WSAEINPROGRESS +#define EALREADY WSAEALREADY +#define ENOTSOCK WSAENOTSOCK +#define EDESTADDRREQ WSAEDESTADDRREQ +#define EMSGSIZE WSAEMSGSIZE +#define EPROTOTYPE WSAEPROTOTYPE +#define ENOPROTOOPT WSAENOPROTOOPT +#define EPROTONOSUPPORT WSAEPROTONOSUPPORT +#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT +#define EOPNOTSUPP WSAEOPNOTSUPP +#define EPFNOSUPPORT WSAEPFNOSUPPORT +#define EAFNOSUPPORT WSAEAFNOSUPPORT +#define EADDRINUSE WSAEADDRINUSE +#define EADDRNOTAVAIL WSAEADDRNOTAVAIL +#define ENETDOWN WSAENETDOWN +#define ENETUNREACH WSAENETUNREACH +#define ENETRESET WSAENETRESET +#define ECONNABORTED WSAECONNABORTED +#define ECONNRESET WSAECONNRESET +#define ENOBUFS WSAENOBUFS +#define EISCONN WSAEISCONN +#define ENOTCONN WSAENOTCONN +#define ESHUTDOWN WSAESHUTDOWN +#define ETOOMANYREFS WSAETOOMANYREFS +#define ETIMEDOUT WSAETIMEDOUT +#define ECONNREFUSED WSAECONNREFUSED +#define ELOOP WSAELOOP +#define ENAMETOOLONG WSAENAMETOOLONG +#define EHOSTDOWN WSAEHOSTDOWN +#define EHOSTUNREACH WSAEHOSTUNREACH +#define ENOTEMPTY WSAENOTEMPTY +#define EPROCLIM WSAEPROCLIM +#define EUSERS WSAEUSERS +#define EDQUOT WSAEDQUOT +#define ESTALE WSAESTALE +#define EREMOTE WSAEREMOTE +#endif + + #endif /* __SETUP_ONCE_H */ diff --git a/lib/connect.c b/lib/connect.c index 464b59098..5be0df27e 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -84,14 +84,6 @@ #define FALSE 0 #endif -#ifdef USE_WINSOCK -#define EINPROGRESS WSAEINPROGRESS -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EISCONN WSAEISCONN -#define ENOTSOCK WSAENOTSOCK -#define ECONNREFUSED WSAECONNREFUSED -#endif - #include "urldata.h" #include "sendf.h" #include "if2ip.h" diff --git a/lib/inet_ntop.c b/lib/inet_ntop.c index f41a3f268..a0b8ba46b 100644 --- a/lib/inet_ntop.c +++ b/lib/inet_ntop.c @@ -55,10 +55,6 @@ #define INADDRSZ 4 #define INT16SZ 2 -#ifdef USE_WINSOCK -#define EAFNOSUPPORT WSAEAFNOSUPPORT -#endif - /* * Format an IPv4 address, more or less like inet_ntoa(). * diff --git a/lib/setup_once.h b/lib/setup_once.h index 38d86db6f..630cd05e3 100644 --- a/lib/setup_once.h +++ b/lib/setup_once.h @@ -193,5 +193,50 @@ typedef int sig_atomic_t; #endif +/* + * Portable error number symbolic names defined to Winsock error codes. + */ + +#ifdef USE_WINSOCK +#define EWOULDBLOCK WSAEWOULDBLOCK +#define EINPROGRESS WSAEINPROGRESS +#define EALREADY WSAEALREADY +#define ENOTSOCK WSAENOTSOCK +#define EDESTADDRREQ WSAEDESTADDRREQ +#define EMSGSIZE WSAEMSGSIZE +#define EPROTOTYPE WSAEPROTOTYPE +#define ENOPROTOOPT WSAENOPROTOOPT +#define EPROTONOSUPPORT WSAEPROTONOSUPPORT +#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT +#define EOPNOTSUPP WSAEOPNOTSUPP +#define EPFNOSUPPORT WSAEPFNOSUPPORT +#define EAFNOSUPPORT WSAEAFNOSUPPORT +#define EADDRINUSE WSAEADDRINUSE +#define EADDRNOTAVAIL WSAEADDRNOTAVAIL +#define ENETDOWN WSAENETDOWN +#define ENETUNREACH WSAENETUNREACH +#define ENETRESET WSAENETRESET +#define ECONNABORTED WSAECONNABORTED +#define ECONNRESET WSAECONNRESET +#define ENOBUFS WSAENOBUFS +#define EISCONN WSAEISCONN +#define ENOTCONN WSAENOTCONN +#define ESHUTDOWN WSAESHUTDOWN +#define ETOOMANYREFS WSAETOOMANYREFS +#define ETIMEDOUT WSAETIMEDOUT +#define ECONNREFUSED WSAECONNREFUSED +#define ELOOP WSAELOOP +#define ENAMETOOLONG WSAENAMETOOLONG +#define EHOSTDOWN WSAEHOSTDOWN +#define EHOSTUNREACH WSAEHOSTUNREACH +#define ENOTEMPTY WSAENOTEMPTY +#define EPROCLIM WSAEPROCLIM +#define EUSERS WSAEUSERS +#define EDQUOT WSAEDQUOT +#define ESTALE WSAESTALE +#define EREMOTE WSAEREMOTE +#endif + + #endif /* __SETUP_ONCE_H */ diff --git a/tests/server/util.h b/tests/server/util.h index a78a485f1..2848560bb 100644 --- a/tests/server/util.h +++ b/tests/server/util.h @@ -49,12 +49,6 @@ void win32_perror (const char *msg); #endif /* WIN32 */ #ifdef USE_WINSOCK -#define EINPROGRESS WSAEINPROGRESS -#define EWOULDBLOCK WSAEWOULDBLOCK -#define EISCONN WSAEISCONN -#define ENOTSOCK WSAENOTSOCK -#define ECONNREFUSED WSAECONNREFUSED - void win32_init(void); void win32_cleanup(void); #endif /* USE_WINSOCK */ -- cgit v1.2.3