|
#include <rt/assert.h>
|
|
|
|
#include <rt/atomic.h>
|
|
#include <rt/trap.h>
|
|
|
|
static rt_atomic(const char *) rt_assert_msg;
|
|
|
|
__attribute__((weak)) void rt_assert(bool condition, const char *msg)
|
|
{
|
|
if (!condition)
|
|
{
|
|
rt_atomic_store(&rt_assert_msg, msg, RT_ATOMIC_SEQ_CST);
|
|
rt_trap();
|
|
}
|
|
}
|