Skip to content

Commit

Permalink
feat: modify macro to assert and panic on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
g-tejas committed Jul 6, 2024
1 parent 4df78d9 commit 7d25928
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defer_t(Fx _fx) -> defer_t<::std::decay_t<Fx>>;

#include <sstream>

#define CHECK_EX(cond_expr, description) \
#define FLUX_ASSERT(cond_expr, description) \
do { \
if (!(cond_expr)) [[unlikely]] { \
std::source_location loc = std::source_location::current(); \
Expand All @@ -34,5 +34,6 @@ defer_t(Fx _fx) -> defer_t<::std::decay_t<Fx>>;
<< description << ", triggered by expression: \n" \
<< "\t" << loc.line() << "\t|\t ... " << #cond_expr << " ...\n"; \
std::printf("%s", ss.str().c_str()); \
std::exit(EXIT_FAILURE); \
} \
} while (0)

0 comments on commit 7d25928

Please sign in to comment.