From 1a4e58d028cee33259f828a33281163ddc665154 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Fri, 18 Jun 2021 14:15:44 +0100 Subject: [PATCH] Define missing macro when cross compiling with clang --- include/etl/limits.h | 5 ++--- include/etl/profiles/determine_compiler.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/etl/limits.h b/include/etl/limits.h index 47b10a22..52023d2a 100644 --- a/include/etl/limits.h +++ b/include/etl/limits.h @@ -332,9 +332,8 @@ namespace etl static ETL_CONSTANT bool is_signed = etl::is_signed::value; static ETL_CONSTANT bool is_modulo = etl::is_unsigned::value; -#if defined(ETL_COMPILER_CLANG) && defined(CROSS_COMPILING_TO_AVR) -#undef WCHAR_MIN -#define WCHAR_MIN (-WCHAR_MAX - 1) +#if defined(ETL_COMPILER_CLANG) && defined(ETL_CROSS_COMPILING_TO_AVR) && !defined(WCHAR_MIN) + #define WCHAR_MIN (-WCHAR_MAX - 1) #endif static ETL_CONSTEXPR wchar_t min() { return WCHAR_MIN; } diff --git a/include/etl/profiles/determine_compiler.h b/include/etl/profiles/determine_compiler.h index 60f33c61..1c2f699d 100644 --- a/include/etl/profiles/determine_compiler.h +++ b/include/etl/profiles/determine_compiler.h @@ -76,7 +76,7 @@ SOFTWARE. #define ETL_COMPILER_CLANG #define ETL_COMPILER_TYPE_DETECTED #if __AVR__ == 1 - #define CROSS_COMPILING_TO_AVR + #define ETL_CROSS_COMPILING_TO_AVR #endif #endif #endif