Implement BUILD_BUG_ON_ZERO() in the LinuxKPI.

Tested using gcc and clang.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2020-06-02 09:45:43 +00:00
parent 9543f281e8
commit c185f13b92

View File

@ -94,6 +94,9 @@
#define BUILD_BUG_ON_NOT_POWER_OF_2(x) BUILD_BUG_ON(!powerof2(x))
#define BUILD_BUG_ON_INVALID(expr) while (0) { (void)(expr); }
extern const volatile int lkpi_build_bug_on_zero;
#define BUILD_BUG_ON_ZERO(x) ((x) ? lkpi_build_bug_on_zero : 0)
#define BUG() panic("BUG at %s:%d", __FILE__, __LINE__)
#define BUG_ON(cond) do { \
if (cond) { \