X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Fassert.h;h=d14ec94e7a263b2cbaa3a72b9ff09dc9d8807886;hb=f081d5336a80b68d3e1bed789cc373c5c3d6699b;hp=bad2ccd04cf3bbc9abe39c2f26ef9b8680d60a9e;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/include/assert.h b/include/assert.h index bad2ccd0..d14ec94e 100644 --- a/include/assert.h +++ b/include/assert.h @@ -1,16 +1,22 @@ +#include + #undef assert #ifdef NDEBUG #define assert(x) (void)0 #else -#define assert(x) ((x) || (__assert_fail(#x, __FILE__, __LINE__, __func__),0)) +#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 *); +_Noreturn void __assert_fail (const char *, const char *, int, const char *); #ifdef __cplusplus }