Kernel: Show the file location when a check fails

This commit is contained in:
apio 2022-11-09 15:23:59 +01:00
parent ea94b331fb
commit da7ad8da5b

View File

@ -1,4 +1,8 @@
#pragma once
#include "panic/Panic.h"
#define ensure(expr) (bool)(expr) || panic("Check failed: " #expr)
#define STRINGIZE(x) #x
#define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
#define ensure(expr) \
(bool)(expr) || panic("Check failed at " __FILE__ ", line " STRINGIZE_VALUE_OF(__LINE__) ": " #expr)