From 7ec35d8e13c28b39d412127ac2459854c66cdfd5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 19 Oct 2012 23:06:53 -0400 Subject: [PATCH] Move un-namespaced container_of into private header --- src/data-device.c | 1 + src/wayland-private.h | 4 ++++ src/wayland-shm.c | 1 + src/wayland-util.h | 4 ---- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/data-device.c b/src/data-device.c index 363a90d..4255c13 100644 --- a/src/data-device.c +++ b/src/data-device.c @@ -25,6 +25,7 @@ #include #include +#include "wayland-private.h" #include "wayland-server.h" static void 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 diff --git a/src/wayland-shm.c b/src/wayland-shm.c index 90c4cf7..47c126b 100644 --- a/src/wayland-shm.c +++ b/src/wayland-shm.c @@ -33,6 +33,7 @@ #include #include +#include "wayland-private.h" #include "wayland-server.h" struct wl_shm_pool { diff --git a/src/wayland-util.h b/src/wayland-util.h index 7c8f563..4b1eca0 100644 --- a/src/wayland-util.h +++ b/src/wayland-util.h @@ -39,10 +39,6 @@ extern "C" { #define WL_EXPORT #endif -#define container_of(ptr, type, member) ({ \ - const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \ - (type *)( (char *)__mptr - offsetof(type,member) );}) - struct wl_message { const char *name; const char *signature; -- 2.7.4