mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-05 19:18:13 +02:00
Define our own container_of as well
Don't rely on libwayland-client/server to define this for us.
This commit is contained in:
parent
5717b6dbf1
commit
8c31a4c025
2 changed files with 8 additions and 0 deletions
|
|
@ -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) );})
|
||||
|
||||
struct window;
|
||||
struct widget;
|
||||
struct display;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,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) );})
|
||||
|
||||
struct weston_transform {
|
||||
struct weston_matrix matrix;
|
||||
struct wl_list link;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue