2c852742d9007f4ba6f6160ae4ea6942d0c32d53
2 * SPDX-License-Identifier: MIT
4 * Copyright 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 #ifndef _BABELTRACE_COMPILER_H
8 #define _BABELTRACE_COMPILER_H
10 #include <stddef.h> /* for offsetof */
12 #define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)]))
15 #define container_of(ptr, type, member) \
17 const typeof(((type *)NULL)->member) * __ptr = (ptr); \
18 (type *)((char *)__ptr - offsetof(type, member)); \
22 #define BT_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
24 #endif /* _BABELTRACE_COMPILER_H */
This page took 0.028922 seconds and 4 git commands to generate.