X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/2d21ac55c334faf3a56e5634905ed6987fc787d4..c7d2c2c6ee645e10cbccdd01c6191873ec77239d:/osfmk/kern/assert.h diff --git a/osfmk/kern/assert.h b/osfmk/kern/assert.h index 1b528a4b3..4c60056fb 100644 --- a/osfmk/kern/assert.h +++ b/osfmk/kern/assert.h @@ -73,21 +73,26 @@ __BEGIN_DECLS extern void Assert( const char *file, int line, - const char *expression); + const char *expression) __attribute__((noinline)); + +#if CONFIG_NO_PANIC_STRINGS +#define Assert(file, line, ex) (Assert)("", line, "") +#endif + __END_DECLS #if MACH_ASSERT #define assert(ex) \ - ((ex) ? (void)0 : Assert(__FILE__, __LINE__, # ex)) -#define assert_static(x) assert(x) + (__builtin_expect(!!((long)(ex)), 1L) ? (void)0 : Assert(__FILE__, __LINE__, # ex)) +#define assert_static(ex) _Static_assert((ex), #ex) #define __assert_only #else /* MACH_ASSERT */ #define assert(ex) ((void)0) -#define assert_static(ex) do {} while (0) +#define assert_static(ex) _Static_assert((ex), #ex) #define __assert_only __unused