diff options
| author | onelin <oscar@nelin.dk> | 2025-11-26 20:29:27 +0000 |
|---|---|---|
| committer | onelin <oscar@nelin.dk> | 2025-11-26 21:36:30 +0000 |
| commit | ffb11b627183797ca38712bde5d1438eedda1d76 (patch) | |
| tree | 90d3ab06d589abf1344ded1cae746c095eddd94a /src/include | |
| parent | 9b1c7caceff6af24d76146bcc7a4495ff9ef3ede (diff) | |
Add ASSERT
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/daw/logging.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/include/daw/logging.h b/src/include/daw/logging.h index 65ca827..fb5f887 100644 --- a/src/include/daw/logging.h +++ b/src/include/daw/logging.h @@ -35,21 +35,25 @@ void _log(FILE* stream, const char* prefix, const char* fmt, va_list ap); void LOG(const char* fmt, ...); +// INFO_ skips writing a final newline void INFO_(const char* fmt, ...); void INFO(const char* fmt, ...); +void WARN(const char* fmt, ...); + +void ERROR(const char* fmt, ...); + #ifdef _DEBUG #define DEBUG(fmt, ...) __DEBUG(__FILE__, __LINE__, __func__, fmt, __VA_ARGS__) void __DEBUG(const char* file, const i32 line, const char* func, const char* fmt, ...); + +#define ASSERT(cond) if (!(cond)) { ERROR("ASSERTION FAILED! " #cond); __asm__("int3;"); } #else #define DEBUG(...) +#define ASSERT(...) #endif -void WARN(const char* fmt, ...); - -void ERROR(const char* fmt, ...); - #ifdef __cplusplus } #endif |
