From 2cdb6b46be0c163798b45547a605cef695fb0212 Mon Sep 17 00:00:00 2001 From: Krzysztof Stachowiak Date: Mon, 22 Oct 2018 10:43:56 +0200 Subject: [PATCH] Include MinGW in the non-conforming (v)snprintf scope It turns out that in some environments MinGW esposes a non-conforming (v)snprintf behavior despite the tests against the MSVC runtime pass. Therefore it has been included in the "non-conforming" scope alongide older MSVC rungime environments. --- include/mbedtls/platform.h | 2 +- library/platform.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/include/mbedtls/platform.h b/include/mbedtls/platform.h index ada898edc..afd6367a2 100644 --- a/include/mbedtls/platform.h +++ b/include/mbedtls/platform.h @@ -59,7 +59,7 @@ extern "C" { * implementations of some standard library functions, including snprintf * and vsnprintf. This affects MSVC and MinGW builds. */ -#if defined(_MSC_VER) && _MSC_VER <= 1900 +#if defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER <= 1900) #define MBEDTLS_PLATFORM_HAS_NON_CONFORMING_SNPRINTF #define MBEDTLS_PLATFORM_HAS_NON_CONFORMING_VSNPRINTF #endif diff --git a/library/platform.c b/library/platform.c index 8bf6ff5fb..4f8e40f30 100644 --- a/library/platform.c +++ b/library/platform.c @@ -30,10 +30,6 @@ #include "mbedtls/platform.h" #include "mbedtls/platform_util.h" -#if defined(__MINGW32__) && !defined(__USE_MINGW_ANSI_STDIO) -#define __USE_MINGW_ANSI_STDIO 1 -#endif - #if defined(MBEDTLS_PLATFORM_MEMORY) #if !defined(MBEDTLS_PLATFORM_STD_CALLOC) static void *platform_calloc_uninit( size_t n, size_t size )