Use __typeof__ instead of typeof
authorKristian Høgsberg <krh@bitplanet.net>
Thu, 22 Dec 2011 20:23:54 +0000 (15:23 -0500)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 22 Dec 2011 20:24:20 +0000 (15:24 -0500)
Thiago Macieira compiles with -std=c++11.

src/wayland-util.h

index 625a2d3..8061368 100644 (file)
@@ -40,8 +40,8 @@ extern "C" {
 #define ALIGN(n, a) ( ((n) + ((a) - 1)) & ~((a) - 1) )
 #define DIV_ROUNDUP(n, a) ( ((n) + ((a) - 1)) / (a) )
 
-#define container_of(ptr, type, member) ({                     \
-       const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
+#define container_of(ptr, type, member) ({                             \
+       const __typeof__( ((type *)0)->member ) *__mptr = (ptr);        \
        (type *)( (char *)__mptr - offsetof(type,member) );})
 
 struct wl_message {