add nyx_warn_once() macro

This commit is contained in:
Sergej Schumilo 2022-12-30 09:28:12 +01:00
parent 0fb4268b3e
commit 1a134e93d8

View File

@ -41,6 +41,14 @@
#define nyx_warn(format, ...) qemu_log(NYX_LOG_PREFIX "Warning: " format, ##__VA_ARGS__)
#define nyx_trace(format, ...) nyx_debug("=> %s\n", __func__)
#define nyx_warn_once(format, ...) \
({ \
static bool _printed = false; \
if (_printed == false){ \
_printed = true; \
nyx_warn(format, ##__VA_ARGS__); \
} \
})
#ifdef ENABLE_BACKTRACES
void qemu_backtrace(void);