#ifndef SIMGRID_XBT_ASSERTS_HPP
#define SIMGRID_XBT_ASSERTS_HPP
-#include <exception>
#include <simgrid/Exception.hpp>
-#include <xbt/log.h>
-
-namespace simgrid {
-namespace xbt {
/**
* @brief Those are the SimGrid version of the good ol' assert macro.
#define _xbt_enforce_ARG1(cond) _xbt_enforce_ARGN((cond), "Assertion %s failed", #cond)
#define _xbt_enforce_ARGN(cond, ...) \
do { \
- if (!(cond)) { \
- throw simgrid::AssertionError(__VA_ARGS__); \
+ if (not(cond)) { \
+ throw simgrid::AssertionError(XBT_THROW_POINT, xbt::string_printf(__VA_ARGS__)); \
} \
} while (0)
-
-} // namespace xbt
-} // namespace simgrid
-
#endif