From 3bb56008ec124501d7d3a6dc705f625bc37b1677 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Wed, 13 Aug 2008 23:09:12 +0300 Subject: [PATCH] VLC_OBJECT: expansion safety --- include/vlc_common.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/vlc_common.h b/include/vlc_common.h index 1e7bbf16b6..8b1c32b7f7 100644 --- a/include/vlc_common.h +++ b/include/vlc_common.h @@ -532,8 +532,12 @@ typedef struct vlc_object_internals_t vlc_object_internals_t; /**@}*/ \ /* VLC_OBJECT: attempt at doing a clever cast */ -#define VLC_OBJECT( x ) \ - (((vlc_object_t *)(x))+0*(x)->be_sure_to_add_VLC_COMMON_MEMBERS_to_struct) +#ifdef __GNUC__ +# define VLC_OBJECT( x ) \ + (((vlc_object_t *)(x))+0*(((typeof(x))0)->be_sure_to_add_VLC_COMMON_MEMBERS_to_struct)) +#else +# define VLC_OBJECT( x ) ((vlc_object_t *)(x)) +#endif #define VLC_GC_MEMBERS \ /** \name VLC_GC_MEMBERS \ -- 2.39.2