BAN/Kernel: Rework assertion/panic system
BAN/Assert.h does not need any includes meaning it can be included anywhere without problems.
This commit is contained in:
22
BAN/BAN/Assert.cpp
Normal file
22
BAN/BAN/Assert.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <BAN/Assert.h>
|
||||
|
||||
#if __is_kernel
|
||||
|
||||
#include <kernel/Panic.h>
|
||||
|
||||
[[noreturn]] void __ban_assertion_failed(const char* location, const char* msg)
|
||||
{
|
||||
Kernel::panic_impl(location, msg);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#include <BAN/Debug.h>
|
||||
|
||||
[[noreturn]] void __ban_assertion_failed(const char* location, const char* msg)
|
||||
{
|
||||
derrorln("{}: {}", location, msg);
|
||||
__builtin_trap();
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user