From d62c535d4cadf9793f9639d1449c172e996430f3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Apr 2016 16:44:16 +0200 Subject: [PATCH] Remove misleading test for __USE_MINGW_ANSI_STDIO This test, added in 06458cb89fb8449f377b0b782404b9a9cbe3ae2d, is useless as it doesn't matter what the value of __USE_MINGW_ANSI_STDIO when compiling the library is, as the real wprintf() implemented used by wxPrintf() is chosen depending on __USE_MINGW_ANSI_STDIO value when compiling the application as wxPrintf() is defined inline. Just remove it because "%ls" works in both cases anyhow, so always use it with MinGW. --- src/common/strvararg.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/common/strvararg.cpp b/src/common/strvararg.cpp index d4550dbfd1..c448c1fb26 100644 --- a/src/common/strvararg.cpp +++ b/src/common/strvararg.cpp @@ -411,12 +411,14 @@ private: }; // Distinguish between the traditional Windows (and MSVC) behaviour and Cygwin -// (which is always Unix-like) and MinGW which can use either depending on the -// "ANSI stdio" option value (which is normally set to either 0 or 1, but test -// for it in a way which works even if it's not defined at all, just in case). +// (which is always Unix-like) and MinGW. The last one is the most interesting +// case as it can behave either as MSVC (__USE_MINGW_ANSI_STDIO=0) or as POSIX +// (__USE_MINGW_ANSI_STDIO=1, which is explicitly set by including any standard +// C++ header such as e.g. ). Luckily, "%ls" and "%lc" work in both +// cases, at least for recent MinGW versions, so just use it always. #if defined(__WINDOWS__) && \ !defined(__CYGWIN__) && \ - (!defined(__MINGW32__) || (__USE_MINGW_ANSI_STDIO +0 == 0)) + !defined(__MINGW32__) // on Windows, we should use %s and %c regardless of the build: class wxPrintfFormatConverterWchar : public wxFormatConverterBase