We explicitly want the compiler to pessimize the taken case of the
assert, so unlikely() is appropriate here.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* NASM assert failure
*/
noreturn nasm_assert_failed(const char *, int, const char *);
-#define nasm_assert(x) \
- do { if (!(x)) nasm_assert_failed(__FILE__,__LINE__,#x); } while (0)
+#define nasm_assert(x) \
+ do { \
+ if (unlikely(!(x))) \
+ nasm_assert_failed(__FILE__,__LINE__,#x); \
+ } while (0)
/*
* ANSI doesn't guarantee the presence of `stricmp' or