X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/84f504218e6e541881d121ba0382f132ff1cf135..1e9ffea6fdfe24e3268eebcda6fa00d34d6a652b:/src/xbt/exception.cpp diff --git a/src/xbt/exception.cpp b/src/xbt/exception.cpp index bcc183bbd8..28d1c349c9 100644 --- a/src/xbt/exception.cpp +++ b/src/xbt/exception.cpp @@ -24,8 +24,7 @@ void _xbt_throw(char* message, const char* file, int line, const char* func) throw e; } -namespace simgrid { -namespace xbt { +namespace simgrid::xbt { ImpossibleError::~ImpossibleError() = default; InitializationError::~InitializationError() = default; @@ -81,8 +80,7 @@ static std::terminate_handler previous_terminate_handler = nullptr; XBT_ATTRIB_NORETURN static void handler() { // Avoid doing crazy things if we get an uncaught exception inside an uncaught exception - static std::atomic_flag lock = ATOMIC_FLAG_INIT; - if (lock.test_and_set()) { + if (static std::atomic_flag lock = ATOMIC_FLAG_INIT; lock.test_and_set()) { XBT_ERROR("Handling an exception raised an exception. Bailing out."); std::abort(); } @@ -130,8 +128,7 @@ void install_exception_handler() }); } -} // namespace xbt -} // namespace simgrid +} // namespace simgrid::xbt void xbt_throw_impossible(const char* file, int line, const char* func) {