From 6c983524a8e367289d554a093dbd8bcfb2fe54cc Mon Sep 17 00:00:00 2001 From: Jerry Yu Date: Fri, 24 Sep 2021 12:45:36 +0800 Subject: [PATCH] Move msvc compatible fix to `common.h` Signed-off-by: Jerry Yu --- include/mbedtls/debug.h | 7 ------- library/common.h | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/mbedtls/debug.h b/include/mbedtls/debug.h index 1f82ce664..0aed59619 100644 --- a/include/mbedtls/debug.h +++ b/include/mbedtls/debug.h @@ -108,13 +108,6 @@ #define MBEDTLS_PRINTF_ATTRIBUTE(string_index, first_to_check) #endif -/* MSVC support __func__ from visual studio 2015( 1900 ) - Use MSVC predefine macro to avoid name check fail. - */ -#if (defined(_MSC_VER) && ( _MSC_VER <= 1900 )) -#define __func__ __FUNCTION__ -#endif - /** * \def MBEDTLS_PRINTF_SIZET * diff --git a/library/common.h b/library/common.h index 780ce378d..ba8237acf 100644 --- a/library/common.h +++ b/library/common.h @@ -318,4 +318,12 @@ extern void (*mbedtls_test_hook_test_fail)( const char * test, int line, const c } #endif +/* Fix MSVC C99 compatible issue + * MSVC support __func__ from visual studio 2015( 1900 ) + * Use MSVC predefine macro to avoid name check fail. + */ +#if (defined(_MSC_VER) && ( _MSC_VER <= 1900 )) +#define __func__ __FUNCTION__ +#endif + #endif /* MBEDTLS_LIBRARY_COMMON_H */