summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-10-09 07:59:21 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-10-09 07:59:21 +0200
commit92124b599a4de4ea072bc80156bd7d1da53d2ef4 (patch)
tree93bc0a1b5a599be32c8fec4dbc88ab1890ccc4bd /compat
parent3a16258e42b6f198c2fb4bfde45c66ee405adac4 (diff)
a
Diffstat (limited to 'compat')
-rw-r--r--compat/assert.hpp12
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