projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use statically known types, use hash for formats
[babeltrace.git]
/
include
/
babeltrace
/
compiler.h
diff --git
a/include/babeltrace/compiler.h
b/include/babeltrace/compiler.h
index 7850ded675a3bb75ce892e2f74d75fcb915561ab..c8bb4db5b8cd38d61be56aa06da8f892d3e13969 100644
(file)
--- a/
include/babeltrace/compiler.h
+++ b/
include/babeltrace/compiler.h
@@
-3,4
+3,12
@@
#define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)]))
#define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)]))
+#ifndef container_of
+#define container_of(ptr, type, member) \
+ ({ \
+ const typeof(((type *)NULL)->member) * __ptr = (ptr); \
+ (type *)((char *)__ptr - offsetof(type, member)); \
+ })
+#endif
+
#endif /* _BABELTRACE_COMPILER_H */
#endif /* _BABELTRACE_COMPILER_H */
This page took
0.023149 seconds
and
4
git commands to generate.