Actually enable fixed snprintf on windows

This commit is contained in:
Manuel Pégourié-Gonnard 2015-06-26 10:52:01 +02:00
parent e1d34d1707
commit 9db2887672
2 changed files with 13 additions and 6 deletions

View file

@ -39,10 +39,19 @@
#error "mbed TLS requires a platform with 8-bit chars"
#endif
#if defined(_WIN32) && !defined(MBEDTLS_PLATFORM_C)
#if defined(_WIN32)
#if !defined(MBEDTLS_PLATFORM_C)
#error "MBEDTLS_PLATFORM_C is required on Windows"
#endif
/* Fix the config here. Not convenient to put an #ifdef _WIN32 in config.h as
* it would confuse config.pl. */
#if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \
!defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO)
#define MBEDTLS_PLATFORM_SNPRINTF_ALT
#endif
#endif /* _WIN32 */
#if defined(MBEDTLS_DEPRECATED_WARNING) && \
!defined(__GNUC__) && !defined(__clang__)
#error "MBEDTLS_DEPRECATED_WARNING only works with GCC and Clang"
@ -286,11 +295,6 @@
#error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites"
#endif
#if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && ( defined(_WIN32)\
&& !defined(EFIX64) && !defined(EFI32) )
#error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined but not available on Windows"
#endif
#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C)
#error "MBEDTLS_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites"
#endif

View file

@ -142,6 +142,9 @@
*
* All these define require MBEDTLS_PLATFORM_C to be defined!
*
* \note MBEDTLS_PLATFORM_SNPRINTF_ALT is required on Windows;
* it will be enabled automatically by check_config.h
*
* \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as
* MBEDTLS_PLATFORM_XXX_MACRO!
*