fixed BUILD_BUG_ON() to work in C++

git-svn-id: svn://anubis/hos/trunk@89 5b3e749e-e535-0410-8002-a9bb6afbdfca
This commit is contained in:
josh 2010-01-22 20:48:41 +00:00
parent 0c78e21e14
commit dccecb054b

View File

@ -27,7 +27,11 @@
#define KERNEL_TIMER_FREQ 1000 #define KERNEL_TIMER_FREQ 1000
#define BUILD_BUG_ON(condition) \ #define BUILD_BUG_ON(condition) \
((void) sizeof(struct { int : -!!(condition); })) do { \
typedef struct { int negative_width_test : ((condition)?-1:1); } \
BUILD_BUG_ON_DUMMY_STRUCT; \
} \
while(0)
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {