bitfield header macros cleanup (style)
[babeltrace.git] / include / babeltrace / compiler.h
CommitLineData
d79865b9
MD
1#ifndef _BABELTRACE_COMPILER_H
2#define _BABELTRACE_COMPILER_H
3
4#define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)]))
5
fc93b2bd
MD
6#ifndef container_of
7#define container_of(ptr, type, member) \
8 ({ \
9 const typeof(((type *)NULL)->member) * __ptr = (ptr); \
10 (type *)((char *)__ptr - offsetof(type, member)); \
11 })
12#endif
13
d79865b9 14#endif /* _BABELTRACE_COMPILER_H */
This page took 0.023007 seconds and 4 git commands to generate.