Commit 49dc768d4c579298d56777348422ebdca565a3ef
1 parent
2734c703
Fix windows build and clean up use of <windows.h>
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
Showing
14 changed files
with
13 additions
and
13 deletions
block-raw-win32.c
| @@ -25,6 +25,7 @@ | @@ -25,6 +25,7 @@ | ||
| 25 | #include "qemu-timer.h" | 25 | #include "qemu-timer.h" |
| 26 | #include "block_int.h" | 26 | #include "block_int.h" |
| 27 | #include <assert.h> | 27 | #include <assert.h> |
| 28 | +#include <windows.h> | ||
| 28 | #include <winioctl.h> | 29 | #include <winioctl.h> |
| 29 | 30 | ||
| 30 | //#define WIN32_AIO | 31 | //#define WIN32_AIO |
block.c
configure
| @@ -590,6 +590,7 @@ if test "$mingw32" = "yes" ; then | @@ -590,6 +590,7 @@ if test "$mingw32" = "yes" ; then | ||
| 590 | oss="no" | 590 | oss="no" |
| 591 | linux_user="no" | 591 | linux_user="no" |
| 592 | bsd_user="no" | 592 | bsd_user="no" |
| 593 | + OS_CFLAGS="$OS_CFLAGS -DWIN32_LEAN_AND_MEAN -DWINVER=0x501" | ||
| 593 | fi | 594 | fi |
| 594 | 595 | ||
| 595 | if test ! -x "$(which cgcc 2>/dev/null)"; then | 596 | if test ! -x "$(which cgcc 2>/dev/null)"; then |
kqemu.c
net.c
osdep.c
| @@ -37,7 +37,6 @@ | @@ -37,7 +37,6 @@ | ||
| 37 | #include "config-host.h" | 37 | #include "config-host.h" |
| 38 | 38 | ||
| 39 | #ifdef _WIN32 | 39 | #ifdef _WIN32 |
| 40 | -#define WIN32_LEAN_AND_MEAN | ||
| 41 | #include <windows.h> | 40 | #include <windows.h> |
| 42 | #elif defined(HOST_BSD) | 41 | #elif defined(HOST_BSD) |
| 43 | #include <stdlib.h> | 42 | #include <stdlib.h> |
qemu-common.h
| @@ -2,12 +2,6 @@ | @@ -2,12 +2,6 @@ | ||
| 2 | #ifndef QEMU_COMMON_H | 2 | #ifndef QEMU_COMMON_H |
| 3 | #define QEMU_COMMON_H | 3 | #define QEMU_COMMON_H |
| 4 | 4 | ||
| 5 | -#ifdef _WIN32 | ||
| 6 | -#define WIN32_LEAN_AND_MEAN | ||
| 7 | -#define WINVER 0x0501 /* needed for ipv6 bits */ | ||
| 8 | -#include <windows.h> | ||
| 9 | -#endif | ||
| 10 | - | ||
| 11 | #define QEMU_NORETURN __attribute__ ((__noreturn__)) | 5 | #define QEMU_NORETURN __attribute__ ((__noreturn__)) |
| 12 | 6 | ||
| 13 | /* Hack around the mess dyngen-exec.h causes: We need QEMU_NORETURN in files that | 7 | /* Hack around the mess dyngen-exec.h causes: We need QEMU_NORETURN in files that |
qemu-img.c
qemu_socket.h
| @@ -3,8 +3,6 @@ | @@ -3,8 +3,6 @@ | ||
| 3 | #define QEMU_SOCKET_H | 3 | #define QEMU_SOCKET_H |
| 4 | 4 | ||
| 5 | #ifdef _WIN32 | 5 | #ifdef _WIN32 |
| 6 | -#define WIN32_LEAN_AND_MEAN | ||
| 7 | -#define WINVER 0x0501 /* needed for ipv6 bits */ | ||
| 8 | #include <windows.h> | 6 | #include <windows.h> |
| 9 | #include <winsock2.h> | 7 | #include <winsock2.h> |
| 10 | #include <ws2tcpip.h> | 8 | #include <ws2tcpip.h> |
savevm.c
slirp/slirp.h
| @@ -29,7 +29,6 @@ typedef uint32_t u_int32_t; | @@ -29,7 +29,6 @@ typedef uint32_t u_int32_t; | ||
| 29 | typedef uint64_t u_int64_t; | 29 | typedef uint64_t u_int64_t; |
| 30 | typedef char *caddr_t; | 30 | typedef char *caddr_t; |
| 31 | 31 | ||
| 32 | -#define WIN32_LEAN_AND_MEAN | ||
| 33 | # include <windows.h> | 32 | # include <windows.h> |
| 34 | # include <winsock2.h> | 33 | # include <winsock2.h> |
| 35 | # include <ws2tcpip.h> | 34 | # include <ws2tcpip.h> |
sysemu.h
| @@ -4,6 +4,10 @@ | @@ -4,6 +4,10 @@ | ||
| 4 | 4 | ||
| 5 | #include "qemu-common.h" | 5 | #include "qemu-common.h" |
| 6 | 6 | ||
| 7 | +#ifdef _WIN32 | ||
| 8 | +#include <windows.h> | ||
| 9 | +#endif | ||
| 10 | + | ||
| 7 | /* vl.c */ | 11 | /* vl.c */ |
| 8 | extern const char *bios_name; | 12 | extern const char *bios_name; |
| 9 | extern const char *bios_dir; | 13 | extern const char *bios_dir; |
tap-win32.c
| @@ -30,7 +30,6 @@ | @@ -30,7 +30,6 @@ | ||
| 30 | #include "net.h" | 30 | #include "net.h" |
| 31 | #include "sysemu.h" | 31 | #include "sysemu.h" |
| 32 | #include <stdio.h> | 32 | #include <stdio.h> |
| 33 | -#define WIN32_LEAN_AND_MEAN | ||
| 34 | #include <windows.h> | 33 | #include <windows.h> |
| 35 | 34 | ||
| 36 | /* NOTE: PCIBus is redefined in winddk.h */ | 35 | /* NOTE: PCIBus is redefined in winddk.h */ |
vl.c