diff options
Diffstat (limited to 'tools/sysinc/assert.h')
| -rw-r--r-- | tools/sysinc/assert.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/sysinc/assert.h b/tools/sysinc/assert.h new file mode 100644 index 0000000..0afd561 --- /dev/null +++ b/tools/sysinc/assert.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: MIT */ + +#ifndef ASSERT_H +#define ASSERT_H + +void __assert_fail(const char *assertion, const char *file, unsigned int line, + const char *function); + +#define assert(expression) \ + ((expression) ? (void)0 : __assert_fail(#expression, __FILE__, __LINE__, __func__)) + +/* Requires C11 */ +#define static_assert _Static_assert + +#endif |
