From 92124b599a4de4ea072bc80156bd7d1da53d2ef4 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 9 Oct 2023 07:59:21 +0200 Subject: a --- compat/assert.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'compat') 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 #include #include @@ -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 -- cgit v1.2.3