2023-02-22 01:17:21 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#if defined(__is_kernel)
|
|
|
|
#include <kernel/Panic.h>
|
2023-05-26 22:21:07 +03:00
|
|
|
#define ASSERT(cond) do { if (!(cond)) Kernel::panic("ASSERT("#cond") failed"); } while (false)
|
2023-02-26 02:53:58 +02:00
|
|
|
#define ASSERT_NOT_REACHED() Kernel::panic("ASSERT_NOT_REACHED() failed")
|
2023-02-22 01:17:21 +02:00
|
|
|
#else
|
2023-03-02 22:30:32 +02:00
|
|
|
#include <assert.h>
|
|
|
|
#define ASSERT(cond) assert((cond) && "ASSERT("#cond") failed")
|
2023-05-26 22:21:07 +03:00
|
|
|
#define ASSERT_NOT_REACHED() do { assert(false && "ASSERT_NOT_REACHED() failed"); __builtin_unreachable(); } while (false)
|
2023-02-22 01:17:21 +02:00
|
|
|
#endif
|