X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d20f024dba9ff1e9c8822237caaf963b9e913889..a0d47b6eaf07218a602ed6606da925fbd3629909:/src/mc/mc_exit.hpp diff --git a/src/mc/mc_exit.hpp b/src/mc/mc_exit.hpp index cede412ee8..234ea1466a 100644 --- a/src/mc/mc_exit.hpp +++ b/src/mc/mc_exit.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2015-2023. 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,23 +6,25 @@ #ifndef SIMGRID_MC_EXIT_HPP #define SIMGRID_MC_EXIT_HPP #include "xbt/base.h" +#include -#define SIMGRID_MC_EXIT_SUCCESS 0 -#define SIMGRID_MC_EXIT_SAFETY 1 -#define SIMGRID_MC_EXIT_LIVENESS 2 -#define SIMGRID_MC_EXIT_DEADLOCK 3 -#define SIMGRID_MC_EXIT_NON_TERMINATION 4 -#define SIMGRID_MC_EXIT_NON_DETERMINISM 5 -#define SIMGRID_MC_EXIT_PROGRAM_CRASH 6 +namespace simgrid::mc { -#define SIMGRID_MC_EXIT_ERROR 63 +enum class ExitStatus { + SUCCESS = 0, + SAFETY = 1, + LIVENESS = 2, + DEADLOCK = 3, + NON_TERMINATION = 4, + NON_DETERMINISM = 5, + PROGRAM_CRASH = 6, + ERROR = 63 +}; -namespace simgrid { -namespace mc { -XBT_PUBLIC_CLASS DeadlockError{}; -XBT_PUBLIC_CLASS TerminationError{}; -XBT_PUBLIC_CLASS LivenessError{}; -} -} +struct McError : public std::exception { + const ExitStatus value; + explicit McError(ExitStatus v = ExitStatus::ERROR) : value(v) {} +}; +} // namespace simgrid::mc #endif