Luna/kernel/include/std/ensure.h
apio 1ea216dfd1 Kernel: Rename assert.h to ensure.h
The macro is named "ensure", the header file should reflect that.
2022-11-09 15:28:35 +01:00

9 lines
267 B
C

#pragma once
#include "panic/Panic.h"
#define STRINGIZE(x) #x
#define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
// clang-format off
#define ensure(expr) (bool)(expr) || panic("Check failed at " __FILE__ ", line " STRINGIZE_VALUE_OF(__LINE__) ": " #expr)
// clang-format on