From 061e522f4cebc6abd52c06fb696050d20efbf870 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Wed, 16 Dec 2020 15:54:13 +0100 Subject: [PATCH] Transform F() macro into a very complicated template --- cores/arduino/Arduino.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cores/arduino/Arduino.h b/cores/arduino/Arduino.h index c40dcb20..8cd4a574 100644 --- a/cores/arduino/Arduino.h +++ b/cores/arduino/Arduino.h @@ -27,6 +27,17 @@ #include #ifdef __cplusplus + +#undef F + +// C++11 declaration +template +auto F(T1&& A) + -> const arduino::__FlashStringHelper* +{ +return (const arduino::__FlashStringHelper*)A; +} + extern "C"{ #endif