summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-14 17:33:06 +0200
committerAllan Sandfeld Jensen <allan.jensen@digia.com>2014-08-15 18:34:49 +0200
commita9fa9b80f57e32ba92284323449840bb556dcbb0 (patch)
tree78f372b51dc7e55ad40daa27bbafdf1ff38c679d /src
parent258d35ceb3142d654d02799516c433ccf7094313 (diff)
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 <gabriel.dedietrich@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qpixelformat.h4
1 files changed, 3 insertions, 1 deletions
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,