w32: Move defines for socket specific errors to qemu-os-win32.h

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>
This commit is contained in:
Stefan Weil 2012-04-12 21:13:15 +02:00
parent 6840981dfb
commit acf126ba58
3 changed files with 26 additions and 18 deletions

View File

@ -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);

View 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);

View 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)