]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gsocket.h: On Windows...
authorThomas Quinot <quinot@adacore.com>
Fri, 8 Aug 2008 12:58:36 +0000 (14:58 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 8 Aug 2008 12:58:36 +0000 (14:58 +0200)
2008-08-08  Thomas Quinot  <quinot@adacore.com>

* gsocket.h:
On Windows, include <errno.h> and redefine only selected errno values
from their <winsock2.h> definitions.

From-SVN: r138874

gcc/ada/gsocket.h

index b98da05f9a78bb994ec20f0a6c7f0364fbae5efd..58c4abb6e5e32ae04e953fee69d74a287fb50711 100644 (file)
@@ -60,6 +60,7 @@
 #endif
 
 #include <limits.h>
+#include <errno.h>
 
 #if defined(__vxworks)
 #include <vxWorks.h>
 #include <winsock2.h>
 #include <ws2tcpip.h>
 
-#define EACCES         WSAEACCES
-#define EADDRINUSE     WSAEADDRINUSE
-#define EADDRNOTAVAIL  WSAEADDRNOTAVAIL
-#define EAFNOSUPPORT   WSAEAFNOSUPPORT
-#define EALREADY       WSAEALREADY
-#define EBADF          WSAEBADF
-#define ECONNABORTED   WSAECONNABORTED
-#define ECONNREFUSED   WSAECONNREFUSED
-#define ECONNRESET     WSAECONNRESET
-#define EDESTADDRREQ   WSAEDESTADDRREQ
-#define EFAULT         WSAEFAULT
-#define EHOSTDOWN      WSAEHOSTDOWN
-#define EHOSTUNREACH   WSAEHOSTUNREACH
-#define EINPROGRESS    WSAEINPROGRESS
-#define EINTR          WSAEINTR
-#define EINVAL         WSAEINVAL
-#define EIO            WSAEDISCON
-#define EISCONN                WSAEISCONN
-#define ELOOP          WSAELOOP
-#define EMFILE         WSAEMFILE
-#define EMSGSIZE       WSAEMSGSIZE
-#define ENAMETOOLONG   WSAENAMETOOLONG
-#define ENETDOWN       WSAENETDOWN
-#define ENETRESET      WSAENETRESET
-#define ENETUNREACH    WSAENETUNREACH
-#define ENOBUFS                WSAENOBUFS
-#define ENOPROTOOPT    WSAENOPROTOOPT
-#define ENOTCONN       WSAENOTCONN
-#define ENOTSOCK       WSAENOTSOCK
-#define EOPNOTSUPP     WSAEOPNOTSUPP
-#define EPFNOSUPPORT   WSAEPFNOSUPPORT
-#define EPROTONOSUPPORT        WSAEPROTONOSUPPORT
-#define ENOTSOCK       WSAENOTSOCK
-#define EOPNOTSUPP     WSAEOPNOTSUPP
-#define EPFNOSUPPORT   WSAEPFNOSUPPORT
-#define EPROTONOSUPPORT        WSAEPROTONOSUPPORT
-#define EPROTOTYPE     WSAEPROTOTYPE
-#define ESHUTDOWN      WSAESHUTDOWN
-#define ESOCKTNOSUPPORT        WSAESOCKTNOSUPPORT
-#define ETIMEDOUT      WSAETIMEDOUT
-#define ETOOMANYREFS   WSAETOOMANYREFS
-#define EWOULDBLOCK    WSAEWOULDBLOCK
+#undef  EACCES
+#define EACCES          WSAEACCES
+#undef  EADDRINUSE
+#define EADDRINUSE      WSAEADDRINUSE
+#undef  EADDRNOTAVAIL
+#define EADDRNOTAVAIL   WSAEADDRNOTAVAIL
+#undef  EAFNOSUPPORT
+#define EAFNOSUPPORT    WSAEAFNOSUPPORT
+#undef  EALREADY
+#define EALREADY        WSAEALREADY
+#undef  EBADF
+#define EBADF           WSAEBADF
+#undef  ECONNABORTED
+#define ECONNABORTED    WSAECONNABORTED
+#undef  ECONNREFUSED
+#define ECONNREFUSED    WSAECONNREFUSED
+#undef  ECONNRESET
+#define ECONNRESET      WSAECONNRESET
+#undef  EDESTADDRREQ
+#define EDESTADDRREQ    WSAEDESTADDRREQ
+#undef  EFAULT
+#define EFAULT          WSAEFAULT
+#undef  EHOSTDOWN
+#define EHOSTDOWN       WSAEHOSTDOWN
+#undef  EHOSTUNREACH
+#define EHOSTUNREACH    WSAEHOSTUNREACH
+#undef  EINPROGRESS
+#define EINPROGRESS     WSAEINPROGRESS
+#undef  EINTR
+#define EINTR           WSAEINTR
+#undef  EINVAL
+#define EINVAL          WSAEINVAL
+#undef  EIO
+#define EIO             WSAEDISCON
+#undef  EISCONN
+#define EISCONN         WSAEISCONN
+#undef  ELOOP
+#define ELOOP           WSAELOOP
+#undef  EMFILE
+#define EMFILE          WSAEMFILE
+#undef  EMSGSIZE
+#define EMSGSIZE        WSAEMSGSIZE
+#undef  ENAMETOOLONG
+#define ENAMETOOLONG    WSAENAMETOOLONG
+#undef  ENETDOWN
+#define ENETDOWN        WSAENETDOWN
+#undef  ENETRESET
+#define ENETRESET       WSAENETRESET
+#undef  ENETUNREACH
+#define ENETUNREACH     WSAENETUNREACH
+#undef  ENOBUFS
+#define ENOBUFS         WSAENOBUFS
+#undef  ENOPROTOOPT
+#define ENOPROTOOPT     WSAENOPROTOOPT
+#undef  ENOTCONN
+#define ENOTCONN        WSAENOTCONN
+#undef  ENOTSOCK
+#define ENOTSOCK        WSAENOTSOCK
+#undef  EOPNOTSUPP
+#define EOPNOTSUPP      WSAEOPNOTSUPP
+#undef  EPFNOSUPPORT
+#define EPFNOSUPPORT    WSAEPFNOSUPPORT
+#undef  EPROTONOSUPPORT
+#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
+#undef  EPROTOTYPE
+#define EPROTOTYPE      WSAEPROTOTYPE
+#undef  ESHUTDOWN
+#define ESHUTDOWN       WSAESHUTDOWN
+#undef  ESOCKTNOSUPPORT
+#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
+#undef  ETIMEDOUT
+#define ETIMEDOUT       WSAETIMEDOUT
+#undef  ETOOMANYREFS
+#define ETOOMANYREFS    WSAETOOMANYREFS
+#undef  EWOULDBLOCK
+#define EWOULDBLOCK     WSAEWOULDBLOCK
+
 #define SHUT_RD                SD_RECEIVE
 #define SHUT_WR                SD_SEND
 #define SHUT_RDWR      SD_BOTH
 
 #endif
 
-#ifndef __MINGW32__
-#include <errno.h>
-#endif
-
 #ifdef __vxworks
 #include <sys/times.h>
 #else