Skip to contentSkip to conversation

mingw32: Enable C99/POSIX format strings

PATCH Applied Stefan Weil 2 participants 2 messages Feb 12, 2010 – Feb 19, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mingw32: Enable C99/POSIX format strings

Starting with mingw32-runtime 3.15, C99/POSIX format strings (%zu, %lld, ...) are supported by defining __USE_MINGW_ANSI_STDIO=1.

As QEMU uses such format strings, unconditionally define this macro. It won't hurt on older revisions of mingw32-runtime.

Tested with manually installed mingw32-runtime 3.15 on debian (cross compiled + wine).

---
 configure |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
configure +2 -0
index 75c28f4..1567ccf 100755
@@ -440,6 +440,8 @@ fi
 if test "$mingw32" = "yes" ; then
   EXESUF=".exe"
   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"
 fi
 
Signature · 1 line
1.6.6.1
#1 lore raw
Quoted 4 lines · Stefan Weil

Starting with mingw32-runtime 3.15, C99/POSIX format strings (%zu, %lld, ...) are supported by defining __USE_MINGW_ANSI_STDIO=1.

Quoted 9 lines

As QEMU uses such format strings, unconditionally define this macro. It won't hurt on older revisions of mingw32-runtime.

Tested with manually installed mingw32-runtime 3.15 on debian (cross compiled + wine).

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 18 lines
---
  configure |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
configure +2 -0
index 75c28f4..1567ccf 100755
@@ -440,6 +440,8 @@ fi
  if test "$mingw32" = "yes" ; then
    EXESUF=".exe"
    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"
  fi