aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/qemu/sockets.h3
-rw-r--r--include/sysemu/os-posix.h2
-rw-r--r--include/sysemu/os-win32.h27
3 files changed, 3 insertions, 29 deletions
diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h
index 0be68de87d..49499f20da 100644
--- a/include/qemu/sockets.h
+++ b/include/qemu/sockets.h
@@ -7,8 +7,6 @@
#include <winsock2.h>
#include <ws2tcpip.h>
-#define socket_error() WSAGetLastError()
-
int inet_aton(const char *cp, struct in_addr *ia);
#else
@@ -20,7 +18,6 @@ int inet_aton(const char *cp, struct in_addr *ia);
#include <netdb.h>
#include <sys/un.h>
-#define socket_error() errno
#define closesocket(s) close(s)
#endif /* !_WIN32 */
diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h
index 5b9c4d6143..e9fec2e250 100644
--- a/include/sysemu/os-posix.h
+++ b/include/sysemu/os-posix.h
@@ -34,6 +34,8 @@ void os_daemonize(void);
void os_setup_post(void);
int os_mlock(void);
+#define socket_error() errno
+
typedef struct timeval qemu_timeval;
#define qemu_gettimeofday(tp) gettimeofday(tp, NULL)
diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h
index fbed346716..239771d51a 100644
--- a/include/sysemu/os-win32.h
+++ b/include/sysemu/os-win32.h
@@ -29,32 +29,6 @@
#include <winsock2.h>
#include <windows.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
-
#if defined(_WIN64)
/* On w64, setjmp is implemented by _setjmp which needs a second parameter.
* If this parameter is NULL, longjump does no stack unwinding.
@@ -80,6 +54,7 @@ struct tm *gmtime_r(const time_t *timep, struct tm *result);
struct tm *localtime_r(const time_t *timep, struct tm *result);
#endif /* CONFIG_LOCALTIME_R */
+int socket_error(void);
static inline void os_setup_signal_handling(void) {}
static inline void os_daemonize(void) {}