forked from enlightenment/enlightenment
Add container_of function.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
b4fbebcd09
commit
4290891c73
|
@ -6,6 +6,12 @@ typedef struct _E_Compositor E_Compositor;
|
|||
# ifndef E_COMP_H
|
||||
# define E_COMP_H
|
||||
|
||||
# define container_of(ptr, type, mbr) \
|
||||
({ \
|
||||
const __typeof__(((type *)0)->mbr) *__mptr = (ptr); \
|
||||
(type *)((char *)__mptr - offsetof(type, mbr)); \
|
||||
})
|
||||
|
||||
struct _E_Compositor
|
||||
{
|
||||
struct
|
||||
|
|
Loading…
Reference in New Issue