From 05288ca11e40bbbda745054453c803d288b7d66d Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Sun, 3 Jul 2016 19:02:03 +1000 Subject: [PATCH] Revert "Drop use of __USE_MINGW_ANSI_STDIO" This reverts commit ac0c02de3cbcd81ff8dac63a529fe978be9c2257. This define is needed when cross compiling from Linux to Windows. --- configure.ac | 1 + tests/utils.tpl | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index 125c9fad..f882bd05 100644 --- a/configure.ac +++ b/configure.ac @@ -174,6 +174,7 @@ case "$host_os" in TYPEOF_SF_COUNT_T="__int64" SF_COUNT_MAX="0x7FFFFFFFFFFFFFFFLL" SIZEOF_SF_COUNT_T=8 + AC_DEFINE([__USE_MINGW_ANSI_STDIO],1,[Set to 1 to use C99 printf/snprintf in MinGW.]) ;; *) SIZEOF_SF_COUNT_T=0 diff --git a/tests/utils.tpl b/tests/utils.tpl index 4b28ab0f..8b5f2d14 100644 --- a/tests/utils.tpl +++ b/tests/utils.tpl @@ -61,7 +61,11 @@ void write_mono_file (const char * filename, int format, int srate, float * outp #ifdef __GNUC__ static inline void exit_if_true (int test, const char *format, ...) +#if (defined (__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO) __attribute__ ((format (gnu_printf, 2, 3))) ; +#else + __attribute__ ((format (printf, 2, 3))) ; +#endif #endif static inline void