X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/84402e8e2ee2a2d0bef25fdceb0a263ed8b471f6..85861efad8a0c75dfc4cca06c3f8adcf86d49495:/src/mc/mc_replay.hpp diff --git a/src/mc/mc_replay.hpp b/src/mc/mc_replay.hpp index 93c9f3edee..823d93e6f4 100644 --- a/src/mc/mc_replay.hpp +++ b/src/mc/mc_replay.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2008-2021. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -6,18 +6,23 @@ #ifndef SIMGRID_MC_REPLAY_H #define SIMGRID_MC_REPLAY_H -#include "src/mc/mc_config.hpp" +#include /** Replay path (if any) in string representation * * This is using the format generated by traceToString(). + * Use a function to avoid static initialization order fiasco. */ -#define MC_record_path (_sg_mc_record_path.get()) +inline auto& MC_record_path() +{ + static std::string value; + return value; +} /** Whether the replay mode is enabled */ static inline int MC_record_replay_is_active() { - return not MC_record_path.empty(); + return not MC_record_path().empty(); } #endif