1 #if !defined(TRUSTY_USERSPACE) 2 // Include LK's assert.h when building for the kernel 3 #include_next <assert.h> 4 #else 5 #include <features.h> 6 7 #undef assert 8 9 #ifdef NDEBUG 10 #define assert(x) (void)0 11 #else 12 #define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0))) 13 #endif 14 15 #if __STDC_VERSION__ >= 201112L && !defined(__cplusplus) 16 #define static_assert _Static_assert 17 #endif 18 19 #ifdef __cplusplus 20 extern "C" { 21 #endif 22 23 _Noreturn void __assert_fail (const char *, const char *, int, const char *); 24 25 #ifdef __cplusplus 26 } 27 #endif 28 #endif 29