Luna/kernel/include/assert.h
2022-09-10 18:42:40 +02:00

14 lines
790 B
C

#pragma once
#include "log/Log.h"
#include "panic/hang.h"
#define __call_assert_fail(...) \
kerrorln(__VA_ARGS__); \
hang();
#define ASSERT(expr) \
do { \
if (!(expr)) { __call_assert_fail("Assertion failed at %s, line %d: %s", __FILE__, __LINE__, #expr) } \
} while (0)
#define TODO(message) __call_assert_fail("TODO at %s, line %d: %s", __FILE__, __LINE__, message)