btrfs-progs: kerncompat: add build-time assertion support

Macro to verify compile-time conditions, like sie of structures or
types.

Signed-off-by: David Sterba <dsterba@suse.com>
master
David Sterba 2016-10-04 22:14:12 +02:00
parent eae42a1fe4
commit c8d9f05cec
1 changed files with 4 additions and 0 deletions

View File

@ -68,6 +68,10 @@
#define ULONG_MAX (~0UL)
#endif
#define __token_glue(a,b,c) ___token_glue(a,b,c)
#define ___token_glue(a,b,c) a ## b ## c
#define BUILD_ASSERT(x) extern int __token_glue(compile_time_assert_,__LINE__,__COUNTER__)[1-2*!(x)] __attribute__((unused))
#ifndef BTRFS_DISABLE_BACKTRACE
#define MAX_BACKTRACE 16
static inline void print_trace(void)