#include #undef assert #define __STDC_VERSION_ASSERT_H__ 202300L // Ensure that this version only accepts arguments that resolve to one // C expression after preprocessing. #ifndef __ASSERT_EXPRESSION #define __ASSERT_EXPRESSION(...) __assert_expression(__VA_ARGS__) static inline _Bool __assert_expression(_Bool __x) { return __x; } #endif #ifdef NDEBUG #define assert(...) (void)0 #else #define assert(...) ((void)(__ASSERT_EXPRESSION(__VA_ARGS__) || (__assert_fail(#__VA_ARGS__, __FILE__, __LINE__, __func__),0))) #endif #if __STDC_VERSION__ >= 201112L && __STDC_VERSION__ < 202311L && !defined(__cplusplus) # define static_assert _Static_assert #endif #ifdef __cplusplus extern "C" { #endif _Noreturn void __assert_fail (const char *, const char *, int, const char *); #ifdef __cplusplus } #endif