debug/assert: give WARN_RETURN a sane name
This commit is contained in:
parent
07b1b04abc
commit
2d9a7109b1
@ -75,6 +75,21 @@ constexpr bool debug_enabled = false;
|
||||
} while (0)
|
||||
|
||||
|
||||
#define RETURN_FALSE_UNLESS(CONDITION) { \
|
||||
if (const auto &__return_false_unless = (CONDITION); !__return_false_unless) { \
|
||||
if constexpr (debug_enabled) { \
|
||||
std::cerr << __FILE__ << ':' \
|
||||
<< __LINE__ << ':' \
|
||||
<< __PRETTY_FUNCTION__ << "; " \
|
||||
<< #CONDITION << '\n'; \
|
||||
breakpoint (); \
|
||||
} \
|
||||
\
|
||||
return false; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
#define WARN_RETURN(CONDITION,VALUE) do { \
|
||||
if (const auto& __warn_return = (CONDITION); !!__warn_return) { \
|
||||
if constexpr (debug_enabled) { \
|
||||
|
Loading…
Reference in New Issue
Block a user