[vlc-commits] Fix VLC_OBJECT expansion

Rémi Denis-Courmont git at videolan.org
Sun Apr 10 20:33:03 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Apr 10 21:22:43 2011 +0300| [68a63466f4e6cd64ebeddabfbc0f4af99d9dc414] | committer: Rémi Denis-Courmont

Fix VLC_OBJECT expansion

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=68a63466f4e6cd64ebeddabfbc0f4af99d9dc414
---

 include/vlc_common.h |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/vlc_common.h b/include/vlc_common.h
index 9cfd1a3..a922430 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -533,12 +533,14 @@ typedef union
 #if defined( __GNUC__ ) && __GNUC__ > 3
 # ifndef __cplusplus
 #  define VLC_OBJECT( x ) \
-    __builtin_choose_expr(__builtin_offsetof(__typeof__(*x), psz_object_type), \
-                          (void)0 /* screw you */, (vlc_object_t *)(x))
+    __builtin_choose_expr( \
+        __builtin_offsetof(__typeof__(*(x)), psz_object_type), \
+        (void)0 /* screw you */, \
+        (vlc_object_t *)(x))
 # else
 #  define VLC_OBJECT( x ) \
     ((vlc_object_t *)(x) \
-      + 0 * __builtin_offsetof(__typeof__(*x), psz_object_type))
+      + 0 * __builtin_offsetof(__typeof__(*(x)), psz_object_type))
 # endif
 #else
 # define VLC_OBJECT( x ) ((vlc_object_t *)(x))



More information about the vlc-commits mailing list