[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/20] w32: Move defines for socket specific errors
From: |
Stefan Weil |
Subject: |
[Qemu-devel] [PATCH 06/20] w32: Move defines for socket specific errors to qemu-os-win32.h |
Date: |
Sun, 15 Apr 2012 16:13:39 +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 <address@hidden>
---
qemu-os-win32.h | 26 ++++++++++++++++++++++++++
qemu_socket.h | 6 ------
slirp/slirp.h | 12 ------------
3 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/qemu-os-win32.h b/qemu-os-win32.h
index 8eda4bd..b6533c0 100644
--- a/qemu-os-win32.h
+++ b/qemu-os-win32.h
@@ -30,6 +30,32 @@
#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);
diff --git a/qemu_socket.h b/qemu_socket.h
index 51ad210..a5d0a84 100644
--- a/qemu_socket.h
+++ b/qemu_socket.h
@@ -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);
diff --git a/slirp/slirp.h b/slirp/slirp.h
index 46bfe46..f2c5eca 100644
--- a/slirp/slirp.h
+++ b/slirp/slirp.h
@@ -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)
--
1.7.0.4
- [Qemu-devel] [PATCH 00/20] w64: Add support for new host, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 01/20] tcg/i386: Use GDB JIT debugging interface only for hosts with ELF, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 02/20] tcg/i386: Add support for w64 ABI, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 03/20] w64: Fix type casts used in some macros in cpu-all.h, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 08/20] w64: Undefine macro SYS_OPEN (fixes a compiler warning), Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 05/20] w64: Use larger alignment for section with generated code, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 06/20] w32: Move defines for socket specific errors to qemu-os-win32.h,
Stefan Weil <=
- [Qemu-devel] [PATCH 09/20] w64: Fix struct CPUTLBEntry, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 13/20] w64: Fix type cast in os_host_main_loop_wait, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 11/20] w64: Use uintptr_t in exec.c, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 14/20] target-mips: Fix type cast for w64 (uintptr_t), Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 16/20] cpu-exec: Remove non-portable type cast and fix format string, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 19/20] w64: Fix time conversion for some versions of MinGW-w64, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 12/20] w64: Fix data types in softmmu*.h, Stefan Weil, 2012/04/15
- [Qemu-devel] [PATCH 20/20] block: Avoid compiler warning for w64, Stefan Weil, 2012/04/15