aboutsummaryrefslogtreecommitdiff
path: root/libs/libc/inc/assert.h
diff options
context:
space:
mode:
authorMarvin Borner2021-04-25 13:43:14 +0200
committerMarvin Borner2021-04-25 13:43:14 +0200
commitf2b4acb2fe6a366288b19843e0d2678b8590bdf4 (patch)
tree1eb869f237908ec0b2516c00f940c6562c5cc5bd /libs/libc/inc/assert.h
parentcd46cefdd74b9ad0b225706f4d4b5864e87d97d6 (diff)
Chu chuu, using the bus for everything now!
Well, I know: bus != train. But I like trains. So I don't care. Go away!
Diffstat (limited to 'libs/libc/inc/assert.h')
-rw-r--r--libs/libc/inc/assert.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/libs/libc/inc/assert.h b/libs/libc/inc/assert.h
index 9621e36..fb5a857 100644
--- a/libs/libc/inc/assert.h
+++ b/libs/libc/inc/assert.h
@@ -8,15 +8,20 @@
#ifdef KERNEL
#include <proc.h>
#define assert(exp) \
- if (!(exp)) { \
- printf("%s:%d: %s: Kernel assertion '%s' failed\n", __FILE__, __LINE__, __func__, \
- #exp); \
- __asm__ volatile("cli\nhlt"); \
+ { \
+ if (!(exp)) { \
+ printf("%s:%d: %s: Kernel assertion '%s' failed\n", __FILE__, __LINE__, \
+ __func__, #exp); \
+ __asm__ volatile("cli\nhlt"); \
+ } \
}
#elif defined(USER)
#define assert(exp) \
- if (!(exp)) \
- err(1, "%s:%d: %s: Assertion '%s' failed\n", __FILE__, __LINE__, __func__, #exp);
+ { \
+ if (!(exp)) \
+ err(1, "%s:%d: %s: Assertion '%s' failed\n", __FILE__, __LINE__, __func__, \
+ #exp); \
+ }
#endif
#endif