@@ -24,6 +24,7 @@
#include "qemu-common.h"
#include "block/coroutine_int.h"
+#include "qemu/winapi.h" /* CreateFiber, ... */
typedef struct
{
@@ -26,10 +26,10 @@
#ifndef QEMU_ETH_H
#define QEMU_ETH_H
-#include <sys/types.h>
#include <string.h>
#include "qemu/bswap.h"
#include "qemu/iov.h"
+#include "qemu/sockets.h" /* u_short */
#define ETH_ALEN 6
@@ -26,8 +26,7 @@
#ifndef QEMU_OS_WIN32_H
#define QEMU_OS_WIN32_H
-#include "qemu/winapi.h"
-#include <winsock2.h>
+#include <winerror.h> /* WSAECONNREFUSED, ... */
/* Workaround for older versions of MinGW. */
#ifndef ECONNREFUSED
@@ -32,6 +32,7 @@
#include "cpu.h"
#include "helper.h"
#include "qemu/log.h"
+#include "qemu/sockets.h" /* select */
enum {
TARGET_SYS_exit = 1,
@@ -31,6 +31,7 @@
/* This needs to be before jpeglib.h line because of conflict with
INT32 definitions between jmorecfg.h (included by jpeglib.h) and
Win32 basetsd.h (included by windows.h). */
+#include "qemu/winapi.h" /* TODO: workaround, remove */
#include "qemu-common.h"
#ifdef CONFIG_VNC_PNG
Most *.o files depend on that file, but many of them don't need windows.h or winsock2.h. sysemu/os-win32.h only needs some definitions from winerror.h. After that change, all files which depend on windows.h or winsock2.h and which no longer get it indirectly have to be fixed. Use qemu/sockets.h to get winsock2.h. Add comments to all those new include statements. The modification in ui/vnc-enc-tight.c is needed temporarily and will be removed again in the following patch. Cc: Anthony Liguori <aliguori@amazon.com> Cc: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> --- coroutine-win32.c | 1 + include/net/eth.h | 2 +- include/sysemu/os-win32.h | 3 +-- target-xtensa/xtensa-semi.c | 1 + ui/vnc-enc-tight.c | 1 + 5 files changed, 5 insertions(+), 3 deletions(-)