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
This commit is contained in:
parent
2734c7037e
commit
49dc768d4c
@ -25,6 +25,7 @@
|
|||||||
#include "qemu-timer.h"
|
#include "qemu-timer.h"
|
||||||
#include "block_int.h"
|
#include "block_int.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
#include <windows.h>
|
||||||
#include <winioctl.h>
|
#include <winioctl.h>
|
||||||
|
|
||||||
//#define WIN32_AIO
|
//#define WIN32_AIO
|
||||||
|
4
block.c
4
block.c
@ -40,6 +40,10 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SECTOR_BITS 9
|
#define SECTOR_BITS 9
|
||||||
#define SECTOR_SIZE (1 << SECTOR_BITS)
|
#define SECTOR_SIZE (1 << SECTOR_BITS)
|
||||||
|
|
||||||
|
1
configure
vendored
1
configure
vendored
@ -590,6 +590,7 @@ if test "$mingw32" = "yes" ; then
|
|||||||
oss="no"
|
oss="no"
|
||||||
linux_user="no"
|
linux_user="no"
|
||||||
bsd_user="no"
|
bsd_user="no"
|
||||||
|
OS_CFLAGS="$OS_CFLAGS -DWIN32_LEAN_AND_MEAN -DWINVER=0x501"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test ! -x "$(which cgcc 2>/dev/null)"; then
|
if test ! -x "$(which cgcc 2>/dev/null)"; then
|
||||||
|
1
kqemu.c
1
kqemu.c
@ -19,7 +19,6 @@
|
|||||||
*/
|
*/
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <winioctl.h>
|
#include <winioctl.h>
|
||||||
#else
|
#else
|
||||||
|
1
net.c
1
net.c
@ -102,6 +102,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
#include <windows.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
#include <mmsystem.h>
|
#include <mmsystem.h>
|
||||||
|
1
osdep.c
1
osdep.c
@ -37,7 +37,6 @@
|
|||||||
#include "config-host.h"
|
#include "config-host.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#elif defined(HOST_BSD)
|
#elif defined(HOST_BSD)
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -2,12 +2,6 @@
|
|||||||
#ifndef QEMU_COMMON_H
|
#ifndef QEMU_COMMON_H
|
||||||
#define 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__))
|
#define QEMU_NORETURN __attribute__ ((__noreturn__))
|
||||||
|
|
||||||
/* Hack around the mess dyngen-exec.h causes: We need QEMU_NORETURN in files that
|
/* Hack around the mess dyngen-exec.h causes: We need QEMU_NORETURN in files that
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
#define QEMU_SOCKET_H
|
#define QEMU_SOCKET_H
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#define WINVER 0x0501 /* needed for ipv6 bits */
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
|
1
savevm.c
1
savevm.c
@ -71,6 +71,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
#include <windows.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
#include <mmsystem.h>
|
#include <mmsystem.h>
|
||||||
|
@ -29,7 +29,6 @@ typedef uint32_t u_int32_t;
|
|||||||
typedef uint64_t u_int64_t;
|
typedef uint64_t u_int64_t;
|
||||||
typedef char *caddr_t;
|
typedef char *caddr_t;
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
# include <winsock2.h>
|
# include <winsock2.h>
|
||||||
# include <ws2tcpip.h>
|
# include <ws2tcpip.h>
|
||||||
|
4
sysemu.h
4
sysemu.h
@ -4,6 +4,10 @@
|
|||||||
|
|
||||||
#include "qemu-common.h"
|
#include "qemu-common.h"
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* vl.c */
|
/* vl.c */
|
||||||
extern const char *bios_name;
|
extern const char *bios_name;
|
||||||
extern const char *bios_dir;
|
extern const char *bios_dir;
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#include "net.h"
|
#include "net.h"
|
||||||
#include "sysemu.h"
|
#include "sysemu.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
/* NOTE: PCIBus is redefined in winddk.h */
|
/* NOTE: PCIBus is redefined in winddk.h */
|
||||||
|
Loading…
Reference in New Issue
Block a user