From b6a42cc53f808c86342d1bcd400ea95e6e7f5762 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 29 Oct 2022 00:54:19 +0200 Subject: serializer work --- compat/assert.hpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'compat') diff --git a/compat/assert.hpp b/compat/assert.hpp index d63b30ff..58edbc15 100644 --- a/compat/assert.hpp +++ b/compat/assert.hpp @@ -25,22 +25,28 @@ namespace floormat { } // namespace floormat -#define fm_EMIT_DEBUG(pfx, ...) \ +#define fm_EMIT_DEBUG2(pfx, ...) \ do { \ if (!std::is_constant_evaluated()) { \ if constexpr (sizeof(pfx) > 1) \ std::fputs((pfx), stderr); \ - FM_KILL_WARN_double_promotion1() \ std::fprintf(stderr, __VA_ARGS__); \ - FM_KILL_WARN_double_promotion2() \ - std::fputc('\n', stderr); \ - std::fflush(stderr); \ } \ } while (false) +#define fm_EMIT_DEBUG(pfx, ...) \ + do { \ + FM_KILL_WARN_double_promotion1() \ + fm_EMIT_DEBUG2(pfx, __VA_ARGS__); \ + FM_KILL_WARN_double_promotion2() \ + std::fputc('\n', stderr); \ + std::fflush(stderr); \ + } while (false) + #define fm_abort(...) \ do { \ - fm_EMIT_DEBUG("fatal: ", __VA_ARGS__); \ + fm_EMIT_DEBUG2("fatal: ", __VA_ARGS__); \ + fm_EMIT_DEBUG("", "in %s:%d", __FILE__, __LINE__); \ ::floormat::_fm_abort(); \ } while (false) -- cgit v1.2.3