diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-02-07 19:05:27 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-08 14:43:18 +0100 |
commit | dd84eab9d8cccedeaaa4b00eea05e498a1aaeae7 (patch) | |
tree | 1c9bd71802e4f827edf5eb0ebac7973166001678 /src/corelib/global | |
parent | 6dc85408cdf2341f8b7c0911abfb3bb6a37021a8 (diff) |
fix msvc 2008 warning about downcasting to bool
the compiler doesn't have static_assert yet, so we ran into the path
which was not fixed by 10229ae.
use !!() pattern instead of bool() cast, as the latter throws off macx
(see 95d7abb). the other alternative - a c-style cast - would cause
autotest failures (see 92464fa), and would be ugly anyway.
Change-Id: Idbe9a3b60e17ae1f566f938d9b9be04f0c977492
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qglobal.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index f0d902f1f5..33b5b8bd76 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1031,7 +1031,7 @@ template <> class QStaticAssertFailure<true> {}; #define Q_STATIC_ASSERT_PRIVATE_JOIN(A, B) Q_STATIC_ASSERT_PRIVATE_JOIN_IMPL(A, B) #define Q_STATIC_ASSERT_PRIVATE_JOIN_IMPL(A, B) A ## B #define Q_STATIC_ASSERT(Condition) \ - enum {Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, __LINE__) = sizeof(QStaticAssertFailure<(Condition)>)} + enum {Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, __LINE__) = sizeof(QStaticAssertFailure<!!(Condition)>)} #define Q_STATIC_ASSERT_X(Condition, Message) Q_STATIC_ASSERT(Condition) #endif |