]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
w32: Move defines for socket specific errors to qemu-os-win32.h
authorStefan Weil <sw@weilnetz.de>
Thu, 12 Apr 2012 19:13:15 +0000 (21:13 +0200)
committerStefan Weil <sw@weilnetz.de>
Sun, 15 Apr 2012 19:25:16 +0000 (21:25 +0200)
As those defines are only used for w32,
they should be in the header file for w32.

All files which include slirp.h or qemu_socket.h also
include qemu-os-win32.h.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
qemu-os-win32.h
qemu_socket.h
slirp/slirp.h

index 8eda4bdc20dafa69f72b71b5c8aa8fd41dbf93b3..b6533c0979c6923bd251dfbc4e789542293e263b 100644 (file)
 #include <winsock2.h>
 #include "main-loop.h"
 
+/* Workaround for older versions of MinGW. */
+#ifndef ECONNREFUSED
+# define ECONNREFUSED WSAECONNREFUSED
+#endif
+#ifndef EINPROGRESS
+# define EINPROGRESS  WSAEINPROGRESS
+#endif
+#ifndef EHOSTUNREACH
+# define EHOSTUNREACH WSAEHOSTUNREACH
+#endif
+#ifndef EINTR
+# define EINTR        WSAEINTR
+#endif
+#ifndef EINPROGRESS
+# define EINPROGRESS  WSAEINPROGRESS
+#endif
+#ifndef ENETUNREACH
+# define ENETUNREACH  WSAENETUNREACH
+#endif
+#ifndef ENOTCONN
+# define ENOTCONN     WSAENOTCONN
+#endif
+#ifndef EWOULDBLOCK
+# define EWOULDBLOCK  WSAEWOULDBLOCK
+#endif
+
 /* Declaration of ffs() is missing in MinGW's strings.h. */
 int ffs(int i);
 
index 51ad210a7f9f4acfb363b445f094551965571d27..a5d0a84fb67b718ca25d4526c180323d70ed1fb7 100644 (file)
@@ -8,12 +8,6 @@
 #include <ws2tcpip.h>
 
 #define socket_error() WSAGetLastError()
-#undef EWOULDBLOCK
-#undef EINTR
-#undef EINPROGRESS
-#define EWOULDBLOCK WSAEWOULDBLOCK
-#define EINTR       WSAEINTR
-#define EINPROGRESS WSAEINPROGRESS
 
 int inet_aton(const char *cp, struct in_addr *ia);
 
index 46bfe4636d76e4531372b9c585739096b24f33d1..f2c5eca892e0c398553ef4dce61e18d2f72da9ae 100644 (file)
@@ -15,18 +15,6 @@ typedef char *caddr_t;
 # include <sys/timeb.h>
 # include <iphlpapi.h>
 
-# undef EWOULDBLOCK
-# undef EINPROGRESS
-# undef ENOTCONN
-# undef EHOSTUNREACH
-# undef ENETUNREACH
-# undef ECONNREFUSED
-# define EWOULDBLOCK WSAEWOULDBLOCK
-# define EINPROGRESS WSAEINPROGRESS
-# define ENOTCONN WSAENOTCONN
-# define EHOSTUNREACH WSAEHOSTUNREACH
-# define ENETUNREACH WSAENETUNREACH
-# define ECONNREFUSED WSAECONNREFUSED
 #else
 # define ioctlsocket ioctl
 # define closesocket(s) close(s)