Kernel: Rename assert.h to ensure.h
The macro is named "ensure", the header file should reflect that.
This commit is contained in:
parent
da7ad8da5b
commit
1ea216dfd1
@ -1,8 +0,0 @@
|
||||
#pragma once
|
||||
#include "panic/Panic.h"
|
||||
|
||||
#define STRINGIZE(x) #x
|
||||
#define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
|
||||
|
||||
#define ensure(expr) \
|
||||
(bool)(expr) || panic("Check failed at " __FILE__ ", line " STRINGIZE_VALUE_OF(__LINE__) ": " #expr)
|
9
kernel/include/std/ensure.h
Normal file
9
kernel/include/std/ensure.h
Normal file
@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
#include "panic/Panic.h"
|
||||
|
||||
#define STRINGIZE(x) #x
|
||||
#define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
|
||||
|
||||
// clang-format off
|
||||
#define ensure(expr) (bool)(expr) || panic("Check failed at " __FILE__ ", line " STRINGIZE_VALUE_OF(__LINE__) ": " #expr)
|
||||
// clang-format on
|
@ -3,7 +3,7 @@
|
||||
#include "gdt/GDT.h"
|
||||
#include "log/Log.h"
|
||||
#include "memory/MemoryManager.h"
|
||||
#include "std/assert.h"
|
||||
#include "std/ensure.h"
|
||||
#include "std/string.h"
|
||||
#include <stdint.h>
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "rand/Mersenne.h"
|
||||
#include "render/Framebuffer.h"
|
||||
#include "render/TextRenderer.h"
|
||||
#include "std/assert.h"
|
||||
#include "std/ensure.h"
|
||||
#include "std/string.h"
|
||||
#include "utils/Time.h"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "memory/VMM.h"
|
||||
#include "misc/hang.h"
|
||||
#include "panic/Panic.h"
|
||||
#include "std/assert.h"
|
||||
#include "std/ensure.h"
|
||||
#include "std/stdio.h"
|
||||
#include "sys/Syscall.h"
|
||||
#include "thread/Scheduler.h"
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include "interrupts/IDT.h"
|
||||
#include "log/Log.h"
|
||||
#include "std/assert.h"
|
||||
#include "std/ensure.h"
|
||||
|
||||
struct IDTEntry
|
||||
{
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "memory/Memory.h"
|
||||
#include "memory/MemoryMap.h"
|
||||
#include "misc/hang.h"
|
||||
#include "std/assert.h"
|
||||
#include "std/ensure.h"
|
||||
#include "std/stdlib.h"
|
||||
#include "thread/PIT.h"
|
||||
#include "thread/Scheduler.h"
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "memory/PMM.h"
|
||||
#include "memory/VMM.h"
|
||||
#include "misc/utils.h"
|
||||
#include "std/assert.h"
|
||||
#include "std/ensure.h"
|
||||
|
||||
void MemoryManager::init()
|
||||
{
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "memory/Memory.h"
|
||||
#include "memory/MemoryManager.h"
|
||||
#include "misc/utils.h"
|
||||
#include "std/assert.h"
|
||||
#include "std/ensure.h"
|
||||
#include "std/string.h"
|
||||
|
||||
extern BOOTBOOT bootboot;
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include "log/Log.h"
|
||||
#include "memory/PMM.h"
|
||||
#include "misc/utils.h"
|
||||
#include "std/assert.h"
|
||||
#include "std/ensure.h"
|
||||
#include "std/string.h"
|
||||
#include "utils/Addresses.h"
|
||||
#include "utils/Registers.h"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#define MODULE "rand"
|
||||
|
||||
#include "rand/Mersenne.h"
|
||||
#include "std/assert.h"
|
||||
#include "std/ensure.h"
|
||||
#include <stddef.h>
|
||||
|
||||
typedef uint64_t word_t;
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "memory/MemoryManager.h"
|
||||
#include "memory/VMM.h"
|
||||
#include "misc/utils.h"
|
||||
#include "std/assert.h"
|
||||
#include "std/ensure.h"
|
||||
#include "std/errno.h"
|
||||
#include "std/stdlib.h"
|
||||
#include "std/string.h"
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "memory/MemoryManager.h"
|
||||
#include "memory/PMM.h"
|
||||
#include "memory/VMM.h"
|
||||
#include "std/assert.h"
|
||||
#include "std/ensure.h"
|
||||
#include "std/errno.h"
|
||||
#include "std/stdlib.h"
|
||||
#include "std/string.h"
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "misc/reboot.h"
|
||||
#include "misc/utils.h"
|
||||
#include "panic/Panic.h"
|
||||
#include "std/assert.h"
|
||||
#include "std/ensure.h"
|
||||
#include "std/errno.h"
|
||||
#include "std/stdlib.h"
|
||||
#include "std/string.h"
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "thread/Task.h"
|
||||
#include "log/Log.h"
|
||||
#include "memory/VMM.h"
|
||||
#include "std/assert.h"
|
||||
#include "std/ensure.h"
|
||||
#include "std/errno.h"
|
||||
#include "std/string.h"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user