From aef44c7970457cc2b673429f8e632e4ac2ee3510 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 4 Sep 2013 23:18:47 -0700 Subject: Don't use an extension to the C++ language in public headers According to Clang 3.3, this is an extension: qpalette.h:178:9: error: anonymous types declared in an anonymous union are an extension [-Werror,-Wnested-anon-types] qsizepolicy.h:148:9: error: anonymous types declared in an anonymous union are an extension [-Werror,-Wnested-anon-types] If you try to simply give the struct a name, it complains with: qpalette.h:178:16: error: types cannot be declared in an anonymous union Change-Id: I61c69b8e42a1f4c4a15a0733f2d7efa0b3e44864 Reviewed-by: Robin Burchell --- src/widgets/kernel/qsizepolicy.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/widgets/kernel/qsizepolicy.h') diff --git a/src/widgets/kernel/qsizepolicy.h b/src/widgets/kernel/qsizepolicy.h index 9c6d67410a..8c3724affb 100644 --- a/src/widgets/kernel/qsizepolicy.h +++ b/src/widgets/kernel/qsizepolicy.h @@ -144,17 +144,18 @@ private: #endif QSizePolicy(int i) : data(i) { } + struct Bits { + quint32 horStretch : 8; + quint32 verStretch : 8; + quint32 horPolicy : 4; + quint32 verPolicy : 4; + quint32 ctype : 5; + quint32 hfw : 1; + quint32 wfh : 1; + quint32 retainSizeWhenHidden : 1; + }; union { - struct { - quint32 horStretch : 8; - quint32 verStretch : 8; - quint32 horPolicy : 4; - quint32 verPolicy : 4; - quint32 ctype : 5; - quint32 hfw : 1; - quint32 wfh : 1; - quint32 retainSizeWhenHidden : 1; - } bits; + Bits bits; quint32 data; }; }; -- cgit v1.2.3