From cd4b9241d28507f4227380abd4e0422469ccf070 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 4 Oct 2023 19:05:08 +0200 Subject: compat/assert: don't add stack frame on top --- compat/assert.hpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/compat/assert.hpp b/compat/assert.hpp index 24b16db8..c406009a 100644 --- a/compat/assert.hpp +++ b/compat/assert.hpp @@ -26,15 +26,10 @@ #define FM_KILL_PRINTF_WARN_2() #endif -namespace floormat { - -[[noreturn]] [[maybe_unused]] static inline void _fm_abort() { - *(volatile int*)nullptr = 0; - for (;;) +#define fm_EMIT_ABORT() \ + *(volatile int*)nullptr = 0; \ + for (;;) \ ; -} - -} // namespace floormat #define fm_EMIT_DEBUG2(pfx, ...) \ do { \ @@ -62,7 +57,7 @@ namespace floormat { do { \ fm_EMIT_DEBUG2("fatal: ", __VA_ARGS__); \ fm_EMIT_DEBUG("", " in %s:%d", __FILE__, __LINE__); \ - ::floormat::_fm_abort(); \ + fm_EMIT_ABORT(); \ } while (false) #define fm_assert(...) \ @@ -70,7 +65,7 @@ namespace floormat { if (!(__VA_ARGS__)) [[unlikely]] { \ fm_EMIT_DEBUG("", "assertion failed: %s in %s:%d", \ #__VA_ARGS__, __FILE__, __LINE__); \ - ::floormat::_fm_abort(); \ + fm_EMIT_ABORT(); \ } \ } while(false) -- cgit v1.2.3