diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-21 14:20:16 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-21 14:20:16 +0200 |
commit | 7a38c6c434e03256d9e9fbff87516b3ad1e3958a (patch) | |
tree | 2cb34a9613fc7f50a6bd7dc0d03eca448e3f5567 /compat/assert.hpp | |
parent | 9a0d8a428b21a77272380009d97436b0a5f20d8c (diff) |
macro shenanigans
Diffstat (limited to 'compat/assert.hpp')
-rw-r--r-- | compat/assert.hpp | 8 |
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 |