Skip to content

Commit

Permalink
Nameless namespace or static linkage don't interfere with IRAM_ATTR, …
Browse files Browse the repository at this point in the history
…after all.
  • Loading branch information
dok-net committed Jan 22, 2020
1 parent fac3a6f commit d67faa8
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/circular_queue/Delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,23 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "circular_queue/ghostl.h"
#endif

namespace
{

template<typename R, typename... P>
R IRAM_ATTR vPtrToFunPtrExec(void* fn, P... args)
{
using target_type = R(P...);
return reinterpret_cast<target_type*>(fn)(std::forward<P...>(args...));
}

}

namespace delegate
{
namespace detail
{

template<typename R, typename... P>
R IRAM_ATTR vPtrToFunPtrExec(void* fn, P... args)
{
using target_type = R(P...);
return reinterpret_cast<target_type*>(fn)(std::forward<P...>(args...));
}

#if !defined(ARDUINO) || defined(ESP8266) || defined(ESP32)
template<typename A, typename R, typename... P>
class DelegatePImpl {
Expand Down

0 comments on commit d67faa8

Please sign in to comment.