libbb: introduce kernel-style BUILD_BUG_ON()
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@@ -64,15 +64,14 @@ struct globals {
|
||||
uint32_t filter_proto;
|
||||
} FIX_ALIASING;
|
||||
#define G (*(struct globals*)&bb_common_bufsiz1)
|
||||
struct BUG_G_too_big {
|
||||
char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1];
|
||||
};
|
||||
#define filter_ifindex (G.filter_ifindex)
|
||||
#define filter_qdisc (G.filter_qdisc)
|
||||
#define filter_parent (G.filter_parent)
|
||||
#define filter_prio (G.filter_prio)
|
||||
#define filter_proto (G.filter_proto)
|
||||
#define INIT_G() do { } while (0)
|
||||
#define INIT_G() do { \
|
||||
BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \
|
||||
} while (0)
|
||||
|
||||
/* Allocates a buffer containing the name of a class id.
|
||||
* The caller must free the returned memory. */
|
||||
|
Reference in New Issue
Block a user