From 25d377114df83d7be78d9cf5cd8bbfa13dc084e9 Mon Sep 17 00:00:00 2001 From: David Hebbeker Date: Wed, 7 Sep 2022 13:37:21 +0200 Subject: [PATCH] Use a different workaround for problems with IARCC. (#594) This approach may be better as is uses the same syntax using `< ... >` as before. Has been suggested here: https://github.com/ETLCPP/etl/pull/593#issuecomment-1239222424 This is based on the insight, that the problem with IARCC occurs only in case the `__has_include` is used as part of a preprocessor definition. See https://github.com/ETLCPP/etl/pull/593#issuecomment-1239208693 --- include/etl/placement_new.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/etl/placement_new.h b/include/etl/placement_new.h index 3efaffb9..d2aff1a7 100644 --- a/include/etl/placement_new.h +++ b/include/etl/placement_new.h @@ -37,7 +37,11 @@ SOFTWARE. // Figure out if we can use the standard library header, if haven't already done so in etl_profile.h #if !defined(ETL_USING_STD_NEW) #if defined(__has_include) - #define ETL_USING_STD_NEW __has_include("new") + #if __has_include() + #define ETL_USING_STD_NEW 1 + #else + #define ETL_USING_STD_NEW 0 + #endif #elif (defined(ARDUINO) && defined(__AVR__)) #define ETL_USING_STD_NEW 0 #else