[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for-3.2 2/4] build-sys: move windows defines in osde
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH for-3.2 2/4] build-sys: move windows defines in osdep.h header |
Date: |
Thu, 22 Nov 2018 15:00:37 +0400 |
This removes some clutter in compilation logging, and allows some
easier tweaking per compilation unit/CFLAGS overriding.
Note that we can't move those define in os-win32.h, since they must be
set before the first system headers are included.
Signed-off-by: Marc-André Lureau <address@hidden>
---
include/qemu/osdep.h | 17 +++++++++++++++++
configure | 3 ---
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 3bf48bcdec..7b6e5db9d0 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -74,13 +74,30 @@ typedef __float128 _Float128;
extern int daemon(int, int);
#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 <stdarg.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include <sys/types.h>
#include <stdlib.h>
+
+/* enable C99/POSIX format strings (needs mingw32-runtime 3.15 or later) */
+#ifdef __MINGW32__
+#define __USE_MINGW_ANSI_STDIO 1
+#endif
#include <stdio.h>
+
#include <string.h>
#include <strings.h>
#include <inttypes.h>
diff --git a/configure b/configure
index 0a3c6a72c3..8c292ef994 100755
--- a/configure
+++ b/configure
@@ -905,9 +905,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"
# MinGW needs -mthreads for TLS and macro _MT.
QEMU_CFLAGS="-mthreads $QEMU_CFLAGS"
LIBS="-lwinmm -lws2_32 -liphlpapi $LIBS"
--
2.20.0.rc1
- [Qemu-devel] [PATCH for-3.2 0/4] build-sys: require Vista API by default globally, Marc-André Lureau, 2018/11/22
- [Qemu-devel] [PATCH for-3.2 2/4] build-sys: move windows defines in osdep.h header,
Marc-André Lureau <=
- [Qemu-devel] [PATCH for-3.2 1/4] build-sys: don't include windows.h, osdep.h does it, Marc-André Lureau, 2018/11/22
- [Qemu-devel] [PATCH for-3.2 3/4] build-sys: build with Vista API by default, Marc-André Lureau, 2018/11/22
- [Qemu-devel] [PATCH for-3.2 4/4] RFC: qga: drop < Vista compatibility, Marc-André Lureau, 2018/11/22
- Re: [Qemu-devel] [PATCH for-3.2 0/4] build-sys: require Vista API by default globally, Paolo Bonzini, 2018/11/29