mirror of
git://git.musl-libc.org/musl
synced 2024-12-24 07:32:49 +00:00
0ed932f34f
some software simply uses static_assert if the macro is defined, and this breaks if the compiler does not recognize the _Static_assert keyword used to define it.
24 lines
418 B
C
24 lines
418 B
C
#include <features.h>
|
|
|
|
#undef assert
|
|
|
|
#ifdef NDEBUG
|
|
#define assert(x) (void)0
|
|
#else
|
|
#define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0)))
|
|
#endif
|
|
|
|
#if __STDC_VERSION__ >= 201112L && !defined(__cplusplus)
|
|
#define static_assert _Static_assert
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
void __assert_fail (const char *, const char *, int, const char *);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|