summaryrefslogtreecommitdiffstats
path: root/src/wayland-private.h
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-10-19 23:06:53 -0400
committerKristian Høgsberg <krh@bitplanet.net>2012-10-19 23:06:53 -0400
commit7ec35d8e13c28b39d412127ac2459854c66cdfd5 (patch)
treea13e31ac9aaf1baa02381501589177ef1468ffba /src/wayland-private.h
parentMove ARRAY_LENGTH out of public headers (diff)
downloadwayland-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.h4
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