diff options
Diffstat (limited to 'src/util.h')
| -rw-r--r-- | src/util.h | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -5,13 +5,16 @@ #define ARRLEN(x) (sizeof(x) / sizeof((x)[0])) -#define ERR(...) stdio_log(LOG_ERR, __VA_ARGS__) -#define WARN(...) stdio_log(LOG_WARN, __VA_ARGS__) -#define INFO(...) stdio_log(LOG_INFO, __VA_ARGS__) -#define DEBUG(...) stdio_log(LOG_DEBUG, __VA_ARGS__) +#define ERR(...) stdio_log(LOG_ERR, "ERR : " __VA_ARGS__) +#define WARN(...) stdio_log(LOG_WARN, "WARN : " __VA_ARGS__) +#define INFO(...) stdio_log(LOG_INFO, "INFO : " __VA_ARGS__) +#define DEBUG(...) stdio_log(LOG_DEBUG, "DEBUG: " __VA_ARGS__) + #define PANIC(...) blink_panic(__VA_ARGS__); -#define ASSERT(cond) blink_panic("Assertion failed: (%s) in %s:%i", \ - #cond, __FILE__, __LINE__) +#define ASSERT(cond) do { \ + if (!(cond)) blink_panic("Assertion failed: (%s) in %s:%i", \ + #cond, __FILE__, __LINE__); \ + } while (0) enum { LOG_NONE, |
