diff options
Diffstat (limited to 'include/linux/kernel.h')
| -rw-r--r-- | include/linux/kernel.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 3c5e4c2e517d..5c1ec1f84eab 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -32,6 +32,7 @@ extern const char linux_banner[]; | |||
| 32 | 32 | ||
| 33 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | 33 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
| 34 | #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1)) | 34 | #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1)) |
| 35 | #define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) | ||
| 35 | 36 | ||
| 36 | #define KERN_EMERG "<0>" /* system is unusable */ | 37 | #define KERN_EMERG "<0>" /* system is unusable */ |
| 37 | #define KERN_ALERT "<1>" /* action must be taken immediately */ | 38 | #define KERN_ALERT "<1>" /* action must be taken immediately */ |
| @@ -336,6 +337,12 @@ struct sysinfo { | |||
| 336 | /* Force a compilation error if condition is true */ | 337 | /* Force a compilation error if condition is true */ |
| 337 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) | 338 | #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) |
| 338 | 339 | ||
| 340 | /* Force a compilation error if condition is true, but also produce a | ||
| 341 | result (of value 0 and type size_t), so the expression can be used | ||
| 342 | e.g. in a structure initializer (or where-ever else comma expressions | ||
| 343 | aren't permitted). */ | ||
| 344 | #define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1) | ||
| 345 | |||
| 339 | /* Trap pasters of __FUNCTION__ at compile-time */ | 346 | /* Trap pasters of __FUNCTION__ at compile-time */ |
| 340 | #define __FUNCTION__ (__func__) | 347 | #define __FUNCTION__ (__func__) |
| 341 | 348 | ||
