aboutsummaryrefslogtreecommitdiff
path: root/libc/inc/assert.h
diff options
context:
space:
mode:
authorMarvin Borner2021-03-26 21:55:50 +0100
committerMarvin Borner2021-03-26 22:02:20 +0100
commit05498860e8f7b1e8bb27880bc7526de026694804 (patch)
tree3bddf16e9439a950a3810d45e42a5cefdbcb7663 /libc/inc/assert.h
parenta96e9c4c858d47f61b89d879aa0ce6a02bdacb38 (diff)
Renamed libs
Cleaner and more flexible.
Diffstat (limited to 'libc/inc/assert.h')
-rw-r--r--libc/inc/assert.h28
1 files changed, 0 insertions, 28 deletions
diff --git a/libc/inc/assert.h b/libc/inc/assert.h
deleted file mode 100644
index 3656c33..0000000
--- a/libc/inc/assert.h
+++ /dev/null
@@ -1,28 +0,0 @@
-// MIT License, Copyright (c) 2020 Marvin Borner
-
-#ifndef ASSERT_H
-#define ASSERT_H
-
-#include <print.h>
-
-#ifdef kernel
-#include <proc.h>
-#define assert(exp) \
- if (!(exp)) { \
- printf("%s:%d: %s: Kernel assertion '%s' failed\n", __FILE__, __LINE__, __func__, \
- #exp); \
- struct proc *assert_proc = proc_current(); \
- if (assert_proc) \
- proc_exit(assert_proc, 1); \
- else \
- __asm__ volatile("cli\nhlt"); \
- }
-#elif defined(userspace)
-#define assert(exp) \
- if (!(exp)) \
- err(1, "%s:%d: %s: Assertion '%s' failed\n", __FILE__, __LINE__, __func__, #exp);
-#else
-#error "No lib target specified. Please use -Dkernel or -Duserspace"
-#endif
-
-#endif