17 lines
380 B
C
17 lines
380 B
C
#pragma once
|
|
|
|
#include <arch.h>
|
|
#include <printf.h>
|
|
|
|
// Make sure `arch_api.panic` and `arch_api.console.putchar` is intialized if calling from architecure-specific code.
|
|
// Will be compiled out if `DEBUG` is not defined.
|
|
static inline void assert(bool condition, const char* msg)
|
|
{
|
|
#if DEBUG
|
|
if (!condition)
|
|
{
|
|
printf(msg);
|
|
arch_api.panic();
|
|
}
|
|
#endif
|
|
} |