Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
load the header needed by this file
[simgrid.git] / src / mc / mc_exit.hpp
index 3ec6ccf..6494e19 100644 (file)
@@ -6,24 +6,25 @@
 #ifndef SIMGRID_MC_EXIT_HPP
 #define SIMGRID_MC_EXIT_HPP
 #include "xbt/base.h"
+#include <exception>
 
-#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
+constexpr int SIMGRID_MC_EXIT_SUCCESS         = 0;
+constexpr int SIMGRID_MC_EXIT_SAFETY          = 1;
+constexpr int SIMGRID_MC_EXIT_LIVENESS        = 2;
+constexpr int SIMGRID_MC_EXIT_DEADLOCK        = 3;
+constexpr int SIMGRID_MC_EXIT_NON_TERMINATION = 4;
+constexpr int SIMGRID_MC_EXIT_NON_DETERMINISM = 5;
+constexpr int SIMGRID_MC_EXIT_PROGRAM_CRASH   = 6;
 
-#define SIMGRID_MC_EXIT_ERROR 63
+constexpr int SIMGRID_MC_EXIT_ERROR           = 63;
 
 namespace simgrid {
 namespace mc {
-class XBT_PUBLIC DeadlockError {
+class XBT_PUBLIC DeadlockError : public std::exception {
 };
-class XBT_PUBLIC TerminationError {
+class XBT_PUBLIC TerminationError : public std::exception {
 };
-class XBT_PUBLIC LivenessError {
+class XBT_PUBLIC LivenessError : public std::exception {
 };
 }
 }