X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/1f2f436a38f7ae2d39a943ad2898d8fed4ed2e58..5f1254882f242514d4ceaf1ecebb140dcc2a511d:/include/assert.h diff --git a/include/assert.h b/include/assert.h index a585ff1..67ae0fd 100644 --- a/include/assert.h +++ b/include/assert.h @@ -66,7 +66,7 @@ int printf(const char * __restrict, ...); __END_DECLS #define assert(e) \ - ((void) ((e) ? 0 : __assert (#e, __FILE__, __LINE__))) + ((void) ((e) ? ((void)0) : __assert (#e, __FILE__, __LINE__))) #define __assert(e, file, line) \ ((void)printf ("%s:%u: failed assertion `%s'\n", file, line, e), abort()) @@ -98,3 +98,14 @@ __END_DECLS #endif /* __GNUC__ */ #endif /* NDEBUG */ + +#ifndef _ASSERT_H_ +#define _ASSERT_H_ + +#ifndef __cplusplus +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +#define static_assert _Static_assert +#endif /* __STDC_VERSION__ */ +#endif /* !__cplusplus */ + +#endif /* _ASSERT_H_ */