From d67faa82d38780ac0f8f209ffaea313d1403e8b9 Mon Sep 17 00:00:00 2001 From: "Dirk O. Kaar" Date: Wed, 22 Jan 2020 09:04:44 +0100 Subject: [PATCH] Nameless namespace or static linkage don't interfere with IRAM_ATTR, after all. --- src/circular_queue/Delegate.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/circular_queue/Delegate.h b/src/circular_queue/Delegate.h index 3789c67..d4b6a19 100644 --- a/src/circular_queue/Delegate.h +++ b/src/circular_queue/Delegate.h @@ -36,18 +36,23 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "circular_queue/ghostl.h" #endif +namespace +{ + + template + R IRAM_ATTR vPtrToFunPtrExec(void* fn, P... args) + { + using target_type = R(P...); + return reinterpret_cast(fn)(std::forward(args...)); + } + +} + namespace delegate { namespace detail { - template - R IRAM_ATTR vPtrToFunPtrExec(void* fn, P... args) - { - using target_type = R(P...); - return reinterpret_cast(fn)(std::forward(args...)); - } - #if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32) template class DelegatePImpl {