diff options
Diffstat (limited to 'klibc/include/assert.h')
-rw-r--r-- | klibc/include/assert.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/klibc/include/assert.h b/klibc/include/assert.h new file mode 100644 index 0000000000..58cc37c487 --- /dev/null +++ b/klibc/include/assert.h @@ -0,0 +1,22 @@ +/* + * assert.h + */ + +#ifndef _ASSERT_H +#define _ASSERT_H + +#ifdef NDEBUG + +#define assert(x) ((void)(x)) + +#else + +extern void __assert_fail(const char *, const char *, + unsigned int); + +#define assert(x) ((x) ? (void)0 : __assert_fail(#x, __FILE__, __LINE__)) + +#endif + +#endif /* _ASSERT_H */ + |