From 994e8fa324cfb0d2eda1e087f9c84de0beba5572 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Mon, 14 Aug 2017 16:10:20 -0400 Subject: [PATCH] Port: fix logging with C99 format specifiers on Mingw MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- logging/log.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) { -- 2.34.1