X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/b0d623f7f2ae71ed96e60569f61f9a9a27016e80..c7d2c2c6ee645e10cbccdd01c6191873ec77239d:/osfmk/kern/assert.h diff --git a/osfmk/kern/assert.h b/osfmk/kern/assert.h index c704dca5f..4c60056fb 100644 --- a/osfmk/kern/assert.h +++ b/osfmk/kern/assert.h @@ -73,7 +73,7 @@ __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, "") @@ -84,15 +84,15 @@ __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