20 lines
349 B
C
20 lines
349 B
C
#ifndef _ASSERT_H
|
|
#define _ASSERT_H 1
|
|
|
|
#define __ASSERT_VOID_CAST (void)
|
|
|
|
#define assert(expr) \
|
|
((expr) ? __ASSERT_VOID_CAST(0) : __assert_fail(__FILE__, __LINE__, #expr))
|
|
|
|
#if defined(__cplusplus)
|
|
extern "C" {
|
|
#endif
|
|
|
|
[[noreturn]] void __assert_fail(const char *file, int line, const char *message);
|
|
|
|
#if defined(__cplusplus)
|
|
}
|
|
#endif
|
|
|
|
#endif
|