Port: fix logging with C99 format specifiers on Mingw
authorMichael Jeanson <mjeanson@efficios.com>
Mon, 14 Aug 2017 20:10:20 +0000 (16:10 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 21 Aug 2017 21:02:23 +0000 (17:02 -0400)
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 <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
logging/log.c

index 1a9fed4bc486c8fcec0673daf1569d020dcbd5ad..7af09e54ed0d77ee00484b67e3aab9d9b7c7ba10 100644 (file)
@@ -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)
        {
This page took 0.025308 seconds and 4 git commands to generate.