diff options
| author | Kristian Høgsberg <krh@bitplanet.net> | 2012-10-19 23:06:53 -0400 |
|---|---|---|
| committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-10-19 23:06:53 -0400 |
| commit | 7ec35d8e13c28b39d412127ac2459854c66cdfd5 (patch) | |
| tree | a13e31ac9aaf1baa02381501589177ef1468ffba /src/wayland-private.h | |
| parent | Move ARRAY_LENGTH out of public headers (diff) | |
| download | wayland-7ec35d8e13c28b39d412127ac2459854c66cdfd5.tar wayland-7ec35d8e13c28b39d412127ac2459854c66cdfd5.tar.gz wayland-7ec35d8e13c28b39d412127ac2459854c66cdfd5.tar.bz2 wayland-7ec35d8e13c28b39d412127ac2459854c66cdfd5.tar.lz wayland-7ec35d8e13c28b39d412127ac2459854c66cdfd5.tar.xz wayland-7ec35d8e13c28b39d412127ac2459854c66cdfd5.tar.zst wayland-7ec35d8e13c28b39d412127ac2459854c66cdfd5.zip | |
Move un-namespaced container_of into private header
Diffstat (limited to 'src/wayland-private.h')
| -rw-r--r-- | src/wayland-private.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wayland-private.h b/src/wayland-private.h index 0d617a7..1b98ce2 100644 --- a/src/wayland-private.h +++ b/src/wayland-private.h @@ -30,6 +30,10 @@ #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) +#define container_of(ptr, type, member) ({ \ + const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) + #define WL_ZOMBIE_OBJECT ((void *) 2) #define WL_MAP_SERVER_SIDE 0 |
