mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-04-24 19:00:23 +08:00
nasmlib.h: Introduce nasm_build_assert
It's useful to protect our self from some errors at build time. For this sake we should use nasm_build_assert if needed. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
638c1ac078
commit
acf256f4db
@ -172,6 +172,11 @@ no_return nasm_assert_failed(const char *, int, const char *);
|
||||
nasm_assert_failed(__FILE__,__LINE__,#x); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* NASM failure at build time if x != 0
|
||||
*/
|
||||
#define nasm_build_assert(x) (void)(sizeof(char[1-2*!!(x)]))
|
||||
|
||||
/*
|
||||
* ANSI doesn't guarantee the presence of `stricmp' or
|
||||
* `strcasecmp'.
|
||||
|
Loading…
x
Reference in New Issue
Block a user