From: Michael Jeanson Date: Mon, 14 Aug 2017 20:10:20 +0000 (-0400) Subject: Port: fix logging with C99 format specifiers on Mingw X-Git-Tag: v2.0.0-pre4~121 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=fc6fdb72c079eb75ec56a110150bd294ab6aef00 Port: fix logging with C99 format specifiers on Mingw On Mingw when __USE_MINGW_ANSI_STDIO is defined, the printf family of functions expects C99 format specifiers instead of the MSVC specific ones. This should be reflected in the logging code to get proper display of C99 types. Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/logging/log.c b/logging/log.c index 1a9fed4b..7af09e54 100644 --- a/logging/log.c +++ b/logging/log.c @@ -490,7 +490,8 @@ extern unsigned long pthread_getsequence_np(pthread_t *); #define memccpy _memccpy #endif -#if (defined(_MSC_VER) && !defined(__INTEL_COMPILER)) || defined(__MINGW64__) +#if (defined(_MSC_VER) && !defined(__INTEL_COMPILER)) || \ + (defined(__MINGW64__) && !defined(__USE_MINGW_ANSI_STDIO)) #define vsnprintf(s, sz, fmt, va) fake_vsnprintf(s, sz, fmt, va) static int fake_vsnprintf(char *s, size_t sz, const char *fmt, va_list ap) {