swissChili | 0b35bf2 | 2021-02-18 12:49:40 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "kint.h" |
| 4 | |
swissChili | 9bd74de | 2021-06-15 20:30:48 -0700 | [diff] [blame] | 5 | #define RESET "\033[0m" |
| 6 | #define INFO "[\033[96m INFO " RESET "] " |
| 7 | #define OKAY "[\033[92m OK " RESET "] " |
| 8 | #define ERROR "[\033[91m ERROR " RESET "] " |
| 9 | #define DEBUG "[\033[93m DEBUG " RESET "] " |
| 10 | |
swissChili | 0b35bf2 | 2021-02-18 12:49:40 -0800 | [diff] [blame] | 11 | void kprintf(const char *format, ...); |
swissChili | 825d46b | 2021-02-21 10:14:16 -0800 | [diff] [blame] | 12 | void kassert_int(bool condition, const char *message, const char *file, |
| 13 | const int line); |
swissChili | 0b35bf2 | 2021-02-18 12:49:40 -0800 | [diff] [blame] | 14 | |
| 15 | #define kassert(cond, msg) kassert_int((cond), (msg), __FILE__, __LINE__) |
swissChili | 9bd74de | 2021-06-15 20:30:48 -0700 | [diff] [blame] | 16 | #define kpanic(msg) \ |
| 17 | kassert(false, msg); \ |
swissChili | 825d46b | 2021-02-21 10:14:16 -0800 | [diff] [blame] | 18 | __builtin_unreachable() |