From 3c6c90086fe3507563abdd1d511e6f264d131572 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 13 Nov 2013 12:59:57 -0500 Subject: [PATCH] gtktextattributes: Only use transparent union for g-ir-scanner https://bugzilla.gnome.org/show_bug.cgi?id=711158 --- gtk/gtktextattributes.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gtk/gtktextattributes.h b/gtk/gtktextattributes.h index 616fc8b24c..cd20c7c82c 100644 --- a/gtk/gtktextattributes.h +++ b/gtk/gtktextattributes.h @@ -94,10 +94,24 @@ struct _GtkTextAppearance guint inside_selection : 1; guint is_text : 1; + /* For the sad story of this bit of code, see + * https://bugzilla.gnome.org/show_bug.cgi?id=711158 + */ +#ifdef __GI_SCANNER__ + /* The scanner should only see the transparent union, so that its + * content does not vary across architectures. + */ union { GdkRGBA *rgba[2]; guint padding[4]; }; +#else + GdkRGBA *rgba[2]; +#if (defined(__SIZEOF_INT__) && defined(__SIZEOF_POINTER__)) && (__SIZEOF_INT__ == __SIZEOF_POINTER__) + /* unusable, just for ABI compat */ + guint padding[2]; +#endif +#endif }; /**