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:
Cyrill Gorcunov 2009-11-05 23:35:04 +03:00
parent 638c1ac078
commit acf256f4db

View file

@ -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'.