From a9fa9b80f57e32ba92284323449840bb556dcbb0 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 14 Aug 2014 17:33:06 +0200 Subject: Fix compilation of QPixelFormat with old clang The enum would break on old clang trying to cast it to strings when building webkit. In file included from /work/build/qt/qtbase/lib/QtGui.framework/Versions/5/Headers/qimage.h:48: /work/build/qt/qtbase/lib/QtGui.framework/Headers/qpixelformat.h:78:33: error: use of overloaded operator '+' is ambiguous (with operand types 'int' and 'QPixelFormat::FieldWidth') Change-Id: I614cf89d0832dea505001d55188b4c748e948ef9 Reviewed-by: Gabriel de Dietrich Reviewed-by: Marc Mutz --- src/gui/kernel/qpixelformat.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gui/kernel/qpixelformat.h') diff --git a/src/gui/kernel/qpixelformat.h b/src/gui/kernel/qpixelformat.h index d11002cbc9..60bfbed824 100644 --- a/src/gui/kernel/qpixelformat.h +++ b/src/gui/kernel/qpixelformat.h @@ -75,7 +75,9 @@ class QPixelFormat enum Field { ModelField = 0, - FirstField = ModelField + ModelFieldWidth, + // work around bug in old clang versions: when building webkit + // with XCode 4.6 and older this fails compilation, thus cast to int + FirstField = ModelField + int(ModelFieldWidth), SecondField = FirstField + FirstFieldWidth, ThirdField = SecondField + SecondFieldWidth, FourthField = ThirdField + ThirdFieldWidth, -- cgit v1.2.3