Move un-namespaced container_of into private header

This commit is contained in:
Kristian Høgsberg 2012-10-19 23:06:53 -04:00
parent bdd272f024
commit 7ec35d8e13
4 changed files with 6 additions and 4 deletions

View file

@ -25,6 +25,7 @@
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include "wayland-private.h"
#include "wayland-server.h" #include "wayland-server.h"
static void static void

View file

@ -30,6 +30,10 @@
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) #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_ZOMBIE_OBJECT ((void *) 2)
#define WL_MAP_SERVER_SIDE 0 #define WL_MAP_SERVER_SIDE 0

View file

@ -33,6 +33,7 @@
#include <sys/mman.h> #include <sys/mman.h>
#include <unistd.h> #include <unistd.h>
#include "wayland-private.h"
#include "wayland-server.h" #include "wayland-server.h"
struct wl_shm_pool { struct wl_shm_pool {

View file

@ -39,10 +39,6 @@ extern "C" {
#define WL_EXPORT #define WL_EXPORT
#endif #endif
#define container_of(ptr, type, member) ({ \
const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
struct wl_message { struct wl_message {
const char *name; const char *name;
const char *signature; const char *signature;