From 6d3237a0b4b532b329949bc26abdcbd4b4325c1a Mon Sep 17 00:00:00 2001 From: Eric Blankenhorn Date: Wed, 20 Jun 2018 09:49:33 -0500 Subject: [PATCH] Add support for C99 tools withoutstrings.h and add option to disable C99 checking. --- wolfssl/wolfcrypt/types.h | 4 ++-- wolfssl/wolfcrypt/wc_port.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index 3329b794f..7008abb50 100755 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -332,8 +332,8 @@ #elif defined(USE_WINDOWS_API) || defined(FREERTOS_TCP_WINSIM) #define XSTRNCASECMP(s1,s2,n) _strnicmp((s1),(s2),(n)) #else - #if (defined(HAVE_STRINGS_H) || defined(WOLF_C99)) && \ - !defined(WOLFSSL_SGX) + #if defined(HAVE_STRINGS_H) && defined(WOLF_C99) && \ + !defined(WOLFSSL_SGX) && !defined(WOLFSSL_ARDUINO) #include #endif #define XSTRNCASECMP(s1,s2,n) strncasecmp((s1),(s2),(n)) diff --git a/wolfssl/wolfcrypt/wc_port.h b/wolfssl/wolfcrypt/wc_port.h index de4f8d9e5..7490b08de 100644 --- a/wolfssl/wolfcrypt/wc_port.h +++ b/wolfssl/wolfcrypt/wc_port.h @@ -33,8 +33,9 @@ extern "C" { #endif -/* detect C99 */ -#if !defined(WOLF_C99) && defined(__STDC_VERSION__) +/* Detect if compiler supports C99. "NO_WOLF_C99" can be defined in + * user_settings.h to disable checking for C99 support. */ +#if !defined(WOLF_C99) && defined(__STDC_VERSION__) && !defined(NO_WOLF_C99) #if __STDC_VERSION__ >= 199901L #define WOLF_C99 #endif