diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-28 13:52:00 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2025-07-28 13:52:00 +0200 |
| commit | 7f24b27652ee6fa84e38f181cea57f319af0c204 (patch) | |
| tree | 269b15baf20c2ae4ed3bb1fdb052340311aa1981 /src/utils | |
| parent | 9b248f3b46d5dc0e9522ed264ef71e422a5bc5a5 (diff) | |
| download | nissy-core-7f24b27652ee6fa84e38f181cea57f319af0c204.tar.gz nissy-core-7f24b27652ee6fa84e38f181cea57f319af0c204.zip | |
Make failed assert exit immediately
Diffstat (limited to '')
| -rw-r--r-- | src/utils/dbg_log.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/dbg_log.h b/src/utils/dbg_log.h index e5b3e24..d737ff2 100644 --- a/src/utils/dbg_log.h +++ b/src/utils/dbg_log.h | |||
| @@ -24,11 +24,11 @@ write_wrapper(void (*write)(const char *, void *), const char *str, ...) | |||
| 24 | #define STATIC | 24 | #define STATIC |
| 25 | #define STATIC_INLINE | 25 | #define STATIC_INLINE |
| 26 | #define DBG_WARN(condition, ...) if (!(condition)) LOG(__VA_ARGS__); | 26 | #define DBG_WARN(condition, ...) if (!(condition)) LOG(__VA_ARGS__); |
| 27 | #define DBG_ASSERT(condition, retval, ...) \ | 27 | #define DBG_ASSERT(condition, ...) \ |
| 28 | if (!(condition)) { LOG(__VA_ARGS__); return retval; } | 28 | if (!(condition)) { LOG(__VA_ARGS__); exit(1); } |
| 29 | #else | 29 | #else |
| 30 | #define STATIC static | 30 | #define STATIC static |
| 31 | #define STATIC_INLINE static inline | 31 | #define STATIC_INLINE static inline |
| 32 | #define DBG_WARN(condition, ...) | 32 | #define DBG_WARN(condition, ...) |
| 33 | #define DBG_ASSERT(condition, retval, ...) | 33 | #define DBG_ASSERT(condition, ...) |
| 34 | #endif | 34 | #endif |
