summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-29 00:54:19 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-29 00:54:19 +0200
commitb6a42cc53f808c86342d1bcd400ea95e6e7f5762 (patch)
treecd65334638415d037e5544c9af5142eab3d6bc7a /compat
parent9954b8b4f5fb95470e127a4f24a0c73289dd49a9 (diff)
serializer work
Diffstat (limited to 'compat')
-rw-r--r--compat/assert.hpp18
1 files changed, 12 insertions, 6 deletions
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)