summaryrefslogtreecommitdiff
path: root/kernel/src/utils/assert.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/utils/assert.hpp')
-rw-r--r--kernel/src/utils/assert.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/src/utils/assert.hpp b/kernel/src/utils/assert.hpp
new file mode 100644
index 0000000..554c7dc
--- /dev/null
+++ b/kernel/src/utils/assert.hpp
@@ -0,0 +1,6 @@
+#pragma once
+
+#include <generic/arch.hpp>
+#include <klibc/stdio.hpp>
+
+#define assert(cond, msg,...) if(!(cond)) { klibc::printf("Failed assert at %s:%s:%d \"" msg "\"\n" , __FILE__ ,__FUNCTION__, __LINE__ , ##__VA_ARGS__); arch::panic((char*)"Failed assert"); } \ No newline at end of file