diff options
Diffstat (limited to 'compat')
-rw-r--r-- | compat/assert.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/compat/assert.hpp b/compat/assert.hpp index 8cbb55be..d9ff2cbe 100644 --- a/compat/assert.hpp +++ b/compat/assert.hpp @@ -1,4 +1,5 @@ #pragma once +#include "defs.hpp" #include <cstdlib> #include <cstdio> #include <type_traits> @@ -86,6 +87,17 @@ } \ } while (false) +#define fm_assert_equal(...) \ + ([](auto a, auto b) -> void \ + { \ + if (a != b) [[unlikely]] \ + { \ + DBG_nospace << "fatal: '" << a << "' != '" << b \ + << "' in " << __FILE__ << ":" << __LINE__; \ + fm_EMIT_ABORT(); \ + } \ + })(__VA_ARGS__) + #ifdef __GNUG__ # pragma GCC diagnostic pop #endif |