diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-04-27 15:55:09 +0100 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-04-27 15:55:09 +0100 |
commit | dc38d274fe183d858c5915f7764241f58422fbe0 (patch) | |
tree | f6f15f0779b686589e90292a57d8f1aaad32e7d2 /xen/include/xen/lib.h | |
parent | bbe9b1dc6cd7b68f27c83974475773002efffb8f (diff) | |
download | xen-dc38d274fe183d858c5915f7764241f58422fbe0.tar.gz xen-dc38d274fe183d858c5915f7764241f58422fbe0.tar.bz2 xen-dc38d274fe183d858c5915f7764241f58422fbe0.zip |
Add BUILD_BUG_ON() and a handful of users.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/include/xen/lib.h')
-rw-r--r-- | xen/include/xen/lib.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h index 8b9253b020..124d49ade5 100644 --- a/xen/include/xen/lib.h +++ b/xen/include/xen/lib.h @@ -16,6 +16,9 @@ #define BUG_ON(_p) do { if (_p) BUG(); } while ( 0 ) +/* Force a compilation error if condition is true */ +#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2 * !!(condition)])) + #ifndef NDEBUG #define ASSERT(_p) { if ( !(_p) ) { printk("Assertion '%s' failed, line %d, file %s\n", #_p , __LINE__, __FILE__); BUG(); } } #else |