Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
assert.h
Go to the documentation of this file.
1 #ifndef ASSERT_H_
2 #define ASSERT_H_
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #ifdef NDEBUG
9 #define assert(x) (void)0
10 #else
11 #define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__), 0)))
12 #endif
13 
14 #if __STDC_VERSION__ >= 201112L && !defined(__cplusplus)
15 #define static_assert _Static_assert
16 #endif
17 
18 __attribute__((noreturn, weak)) void __assert_fail(const char* expr, const char* file,
19  unsigned int line, const char* function);
20 
21 #ifdef __cplusplus
22 }
23 #endif
24 
25 #endif // ASSERT_H_
__attribute__((noreturn, weak)) void __assert_fail(const char *expr
const char * file
Definition: assert.h:18
const char unsigned int line
Definition: assert.h:18