From 3078d6318cafa1c1b27ad35fe7c09ad1e1eee001 Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Mon, 26 Mar 2018 16:31:17 +0200 Subject: [PATCH] [SMPI] Replay: Move callbacks to std::function --- examples/smpi/replay/replay.cpp | 2 +- include/xbt/replay.hpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/smpi/replay/replay.cpp b/examples/smpi/replay/replay.cpp index 2ac6850081..e101ddd62c 100644 --- a/examples/smpi/replay/replay.cpp +++ b/examples/smpi/replay/replay.cpp @@ -17,7 +17,7 @@ static void action_blah(simgrid::xbt::ReplayAction& args) action_fun previous_send; static void overriding_send(simgrid::xbt::ReplayAction& args) { - (*previous_send)(args); // Just call the overriden symbol. That's a toy example. + previous_send(args); // Just call the overriden symbol. That's a toy example. } int main(int argc, char* argv[]) diff --git a/include/xbt/replay.hpp b/include/xbt/replay.hpp index 72f5069068..a83d442f66 100644 --- a/include/xbt/replay.hpp +++ b/include/xbt/replay.hpp @@ -11,6 +11,7 @@ #include /* SG_BEGIN_DECL */ #include +#include #include #include @@ -25,7 +26,7 @@ XBT_PUBLIC int replay_runner(int argc, char* argv[]); } } -typedef void (*action_fun)(simgrid::xbt::ReplayAction&); +typedef std::function action_fun; XBT_PUBLIC void xbt_replay_action_register(const char* action_name, action_fun function); XBT_PUBLIC action_fun xbt_replay_action_get(const char* action_name); -- 2.20.1