]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Fix windows build and clean up use of <windows.h>
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 8 Mar 2009 16:26:59 +0000 (16:26 +0000)
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 8 Mar 2009 16:26:59 +0000 (16:26 +0000)
We want to globally define WIN_LEAN_AND_MEAN and WINVER to particular values so
let's do it in OS_CFLAGS.

Then, we can pepper in windows.h includes where using #includes that require it.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6783 c046a42c-6fe2-441c-8c8c-71466251a162

14 files changed:
block-raw-win32.c
block.c
configure
kqemu.c
net.c
osdep.c
qemu-common.h
qemu-img.c
qemu_socket.h
savevm.c
slirp/slirp.h
sysemu.h
tap-win32.c
vl.c

index 19fa80dd76f0f77bc39048826ca8f548c7d8c544..6387b09593f836fb70780a2c556f6d19b5726be0 100644 (file)
@@ -25,6 +25,7 @@
 #include "qemu-timer.h"
 #include "block_int.h"
 #include <assert.h>
+#include <windows.h>
 #include <winioctl.h>
 
 //#define WIN32_AIO
diff --git a/block.c b/block.c
index 36de3b6183f8644049824b87a96b75926647ccd2..bd65ed36116c84221e33dfd80c69ddd77a03cad8 100644 (file)
--- a/block.c
+++ b/block.c
 #endif
 #endif
 
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
 #define SECTOR_BITS 9
 #define SECTOR_SIZE (1 << SECTOR_BITS)
 
index 22795e85a15e6a9dbb29cd3690960d901bde1c9b..819817a37a8dc1acaf43858bef5b508aa1a37b18 100755 (executable)
--- a/configure
+++ b/configure
@@ -590,6 +590,7 @@ if test "$mingw32" = "yes" ; then
     oss="no"
     linux_user="no"
     bsd_user="no"
+    OS_CFLAGS="$OS_CFLAGS -DWIN32_LEAN_AND_MEAN -DWINVER=0x501"
 fi
 
 if test ! -x "$(which cgcc 2>/dev/null)"; then
diff --git a/kqemu.c b/kqemu.c
index 25f4ea784aae2c5360858a36a00109172dde56b0..96660b0132cbf15e31c4873ba5512121ae4d4e18 100644 (file)
--- a/kqemu.c
+++ b/kqemu.c
@@ -19,7 +19,6 @@
  */
 #include "config.h"
 #ifdef _WIN32
-#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <winioctl.h>
 #else
diff --git a/net.c b/net.c
index 90c4b5b3c641ecccdf865c6b22baac29ec87779a..c853dafb86235b7574e66b1a31a9f2ba99d3f69e 100644 (file)
--- a/net.c
+++ b/net.c
 #endif
 
 #ifdef _WIN32
+#include <windows.h>
 #include <malloc.h>
 #include <sys/timeb.h>
 #include <mmsystem.h>
diff --git a/osdep.c b/osdep.c
index a583d77a0a32c994430783938b3f03a4e95248e7..91fb39efaaf4ee7fe614bd3785d380ca3da37173 100644 (file)
--- a/osdep.c
+++ b/osdep.c
@@ -37,7 +37,6 @@
 #include "config-host.h"
 
 #ifdef _WIN32
-#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #elif defined(HOST_BSD)
 #include <stdlib.h>
index f8ac7e6fd64a92962a9fc6a763cd6bf1f617b557..6848b337fa4f961734bda1f9154476a76085ccaa 100644 (file)
@@ -2,12 +2,6 @@
 #ifndef QEMU_COMMON_H
 #define QEMU_COMMON_H
 
-#ifdef _WIN32
-#define WIN32_LEAN_AND_MEAN
-#define WINVER 0x0501  /* needed for ipv6 bits */
-#include <windows.h>
-#endif
-
 #define QEMU_NORETURN __attribute__ ((__noreturn__))
 
 /* Hack around the mess dyngen-exec.h causes: We need QEMU_NORETURN in files that
index d83ffe3ee9df56dc601b478af17cfab4dc34f33b..2af695fbe64a7a03fe7d3eb4418226469ef3c859 100644 (file)
@@ -27,7 +27,6 @@
 #include <assert.h>
 
 #ifdef _WIN32
-#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #endif
 
index c8ca07ea7d65a58a61dfba633f627a069e5a64ba..fc5b5889b790c5dd60e7808089c97f69401cb0a6 100644 (file)
@@ -3,8 +3,6 @@
 #define QEMU_SOCKET_H
 
 #ifdef _WIN32
-#define WIN32_LEAN_AND_MEAN
-#define WINVER 0x0501  /* needed for ipv6 bits */
 #include <windows.h>
 #include <winsock2.h>
 #include <ws2tcpip.h>
index 837a9f01c6cd137bd34a3da63ad6ab3da2669fe6..6104f629ab3e5f1f064ed67103294fa7d8c07118 100644 (file)
--- a/savevm.c
+++ b/savevm.c
@@ -71,6 +71,7 @@
 #endif
 
 #ifdef _WIN32
+#include <windows.h>
 #include <malloc.h>
 #include <sys/timeb.h>
 #include <mmsystem.h>
index 6f8a7f60228825e3153c363c24f3d9ef9bc188b8..8309fe051c01f9ef63209f275d8f8bfc812f556f 100644 (file)
@@ -29,7 +29,6 @@ typedef uint32_t u_int32_t;
 typedef uint64_t u_int64_t;
 typedef char *caddr_t;
 
-#define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 # include <winsock2.h>
 # include <ws2tcpip.h>
index 8775412b7c7c2be6fff70444126fb696be99f7b0..3eab34b399e732a3504ffaf3803e040eaea75a86 100644 (file)
--- a/sysemu.h
+++ b/sysemu.h
@@ -4,6 +4,10 @@
 
 #include "qemu-common.h"
 
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
 /* vl.c */
 extern const char *bios_name;
 extern const char *bios_dir;
index 32796442360407d73e36b370f98d074fc7c4fc0e..df31fda49718f7d5eb8727c523da9fab9129386c 100644 (file)
@@ -30,7 +30,6 @@
 #include "net.h"
 #include "sysemu.h"
 #include <stdio.h>
-#define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
 /* NOTE: PCIBus is redefined in winddk.h */
diff --git a/vl.c b/vl.c
index 06e9f733524c7c8db56809fd97b5172b86245b62..b7417008ad35d4fa45b5c46025f0327502942fbb 100644 (file)
--- a/vl.c
+++ b/vl.c
 #endif
 
 #ifdef _WIN32
+#include <windows.h>
 #include <malloc.h>
 #include <sys/timeb.h>
 #include <mmsystem.h>