2021-05-16 18:05:56 +02:00
|
|
|
/*
|
|
|
|
** assert.h> can be included several times and the assert macro is redefined
|
|
|
|
** every time to match the definition of NDEBUG (7.2§1)
|
|
|
|
*/
|
|
|
|
#ifdef __ASSERT_H__
|
|
|
|
# undef __ASSERT_H__
|
|
|
|
# undef assert
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define __ASSERT_H__
|
|
|
|
|
2021-06-28 15:49:05 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2021-05-16 18:05:56 +02:00
|
|
|
/* Internal function that prints error message and aborts */
|
|
|
|
void __assert_fail(char const *__file, int __line, char const *__function,
|
|
|
|
char const *__expression);
|
|
|
|
|
|
|
|
#ifdef NDEBUG
|
|
|
|
# define assert(ignore) ((void)0)
|
|
|
|
#else
|
|
|
|
# define assert(expression) \
|
|
|
|
((expression) \
|
2021-05-30 23:16:09 +02:00
|
|
|
? (void)0 \
|
2021-05-16 18:05:56 +02:00
|
|
|
: __assert_fail(__FILE__, __LINE__, __PRETTY_FUNCTION__, #expression))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __cplusplus
|
|
|
|
# define static_assert _Static_assert
|
|
|
|
#endif
|
2021-06-28 15:49:05 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|