From: Kristian Høgsberg Date: Tue, 24 Jan 2012 14:52:25 +0000 (-0500) Subject: wayland-util.h: Avoid un-namespaced _container_of X-Git-Tag: 0.85.0~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa525622e33216207b6bba6ef5b4c434d565e4d1;p=platform%2Fupstream%2Fwayland.git wayland-util.h: Avoid un-namespaced _container_of Yes, there are worse offenders in that file, but this one isn't used in the code and it makes Xorg angry. --- diff --git a/src/wayland-util.h b/src/wayland-util.h index f56af59..25c0901 100644 --- a/src/wayland-util.h +++ b/src/wayland-util.h @@ -107,32 +107,32 @@ int wl_list_empty(struct wl_list *list); void wl_list_insert_list(struct wl_list *list, struct wl_list *other); #ifdef __GNUC__ -#define __container_of(ptr, sample, member) \ +#define __wl_container_of(ptr, sample, member) \ (__typeof__(sample))((char *)(ptr) - \ ((char *)&(sample)->member - (char *)(sample))) #else -#define __container_of(ptr, sample, member) \ +#define __wl_container_of(ptr, sample, member) \ (void *)((char *)(ptr) - \ ((char *)&(sample)->member - (char *)(sample))) #endif #define wl_list_for_each(pos, head, member) \ - for (pos = 0, pos = __container_of((head)->next, pos, member); \ + for (pos = 0, pos = __wl_container_of((head)->next, pos, member); \ &pos->member != (head); \ - pos = __container_of(pos->member.next, pos, member)) + pos = __wl_container_of(pos->member.next, pos, member)) #define wl_list_for_each_safe(pos, tmp, head, member) \ for (pos = 0, tmp = 0, \ - pos = __container_of((head)->next, pos, member), \ - tmp = __container_of((pos)->member.next, tmp, member); \ + pos = __wl_container_of((head)->next, pos, member), \ + tmp = __wl_container_of((pos)->member.next, tmp, member); \ &pos->member != (head); \ pos = tmp, \ - tmp = __container_of(pos->member.next, tmp, member)) + tmp = __wl_container_of(pos->member.next, tmp, member)) #define wl_list_for_each_reverse(pos, head, member) \ - for (pos = 0, pos = __container_of((head)->prev, pos, member); \ + for (pos = 0, pos = __wl_container_of((head)->prev, pos, member); \ &pos->member != (head); \ - pos = __container_of(pos->member.prev, pos, member)) + pos = __wl_container_of(pos->member.prev, pos, member)) struct wl_array { uint32_t size;