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-Url: http://drtracing.org/?a=commitdiff_plain;h=994e8fa324cfb0d2eda1e087f9c84de0beba5572;p=deliverable%2Fbabeltrace.git 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 1a9fed4bc..7af09e54e 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) {