Skip to content

Commit 004594a

Browse files
committed
Issue 10316: Workaround bug in getStdFunctionAddress
1 parent cbe0f2f commit 004594a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Diff for: libraries/Network/src/NetworkEvents.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,8 @@ void NetworkEvents::removeEvent(NetworkEventCb cbEvent, arduino_event_id_t event
225225
}
226226
}
227227

228-
template<typename T, typename... U> static size_t getStdFunctionAddress(std::function<T(U...)> f) {
229-
typedef T(fnType)(U...);
230-
fnType **fnPointer = f.template target<fnType *>();
231-
return (size_t)*fnPointer;
228+
static size_t getStdFunctionAddress(NetworkEventFuncCb cbEvent) {
229+
return *(size_t *)(void *)&cbEvent;
232230
}
233231

234232
void NetworkEvents::removeEvent(NetworkEventFuncCb cbEvent, arduino_event_id_t event) {

0 commit comments

Comments
 (0)