diff --git a/qemu/configure b/qemu/configure index 522900ff..d4d12f53 100755 --- a/qemu/configure +++ b/qemu/configure @@ -492,9 +492,6 @@ fi if test "$mingw32" = "yes" ; then EXESUF=".exe" DSOSUF=".dll" - QEMU_CFLAGS="-DWIN32_LEAN_AND_MEAN -DWINVER=0x501 $QEMU_CFLAGS" - # enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) - QEMU_CFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $QEMU_CFLAGS" LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS" write_c_skeleton; if compile_prog "" "-liberty" ; then diff --git a/qemu/include/qemu/osdep.h b/qemu/include/qemu/osdep.h index 93be8e41..1afa4976 100644 --- a/qemu/include/qemu/osdep.h +++ b/qemu/include/qemu/osdep.h @@ -61,13 +61,29 @@ typedef __float128 _Float128; #define __STDC_FORMAT_MACROS #endif +#ifdef _WIN32 +/* as defined in sdkddkver.h */ +#ifndef WINVER +#define WINVER 0x0501 /* XP */ +#endif +/* reduces the number of implicitly included headers */ +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif +#endif #include #include #include "unicorn/platform.h" #include #include + +/* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */ +#ifdef __MINGW32__ +#define __USE_MINGW_ANSI_STDIO 1 +#endif #include + #include #include #include