summaryrefslogtreecommitdiffhomepage
path: root/compat/assert.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-21 14:20:16 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-21 14:20:16 +0200
commit7a38c6c434e03256d9e9fbff87516b3ad1e3958a (patch)
tree2cb34a9613fc7f50a6bd7dc0d03eca448e3f5567 /compat/assert.hpp
parent9a0d8a428b21a77272380009d97436b0a5f20d8c (diff)
macro shenanigans
Diffstat (limited to 'compat/assert.hpp')
-rw-r--r--compat/assert.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/compat/assert.hpp b/compat/assert.hpp
index 44b401fa..c91dd785 100644
--- a/compat/assert.hpp
+++ b/compat/assert.hpp
@@ -47,6 +47,14 @@
#define fm_log(...) fm_EMIT_DEBUG("", __VA_ARGS__)
#define fm_debug(...) fm_EMIT_DEBUG("", __VA_ARGS__)
+#define fm_warn_once(...) do { \
+ static bool _fm_once_flag = false; \
+ if (!_fm_once_flag) { \
+ _fm_once_flag = true; \
+ fm_warn(__VA_ARGS__); \
+ } \
+ } while (false)
+
#ifdef __GNUG__
# pragma GCC diagnostic pop
#endif