From 48faa8ed5a34f0780cded4546547cee96fc1dc2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 4 Nov 2020 11:55:24 +0200 Subject: [PATCH] Add _MSC_VER check to MSVC ARM compiler workaround While _M_ARM is a MSVC specific builtin define, mingw headers do also define it (in code, as opposed to a compiler built in define), just as the same headers do for e.g. _M_IX86 and _M_X64. This avoids warnings about unrecognized pragmas, when compiling for armv7 mingw. The original compiler bug (from QTBUG-42038) probably already is fixed and/or no longer in scope. Change-Id: I98722e2a7ee1de4f1937a866555ec460f5d898d1 Pick-to: 5.15 Reviewed-by: Friedemann Kleint --- src/gui/image/qimage.cpp | 4 ++-- src/gui/image/qimage_p.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index b973b1c6a08..6edf48d3ba2 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -181,7 +181,7 @@ QImageData::~QImageData() data = nullptr; } -#if defined(_M_ARM) +#if defined(_M_ARM) && defined(_MSC_VER) #pragma optimize("", off) #endif @@ -311,7 +311,7 @@ bool QImageData::checkForAlphaPixels() const return has_alpha_pixels; } -#if defined(_M_ARM) +#if defined(_M_ARM) && defined(_MSC_VER) #pragma optimize("", on) #endif diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h index 6ca415d1873..2fbb646c2ed 100644 --- a/src/gui/image/qimage_p.h +++ b/src/gui/image/qimage_p.h @@ -167,7 +167,7 @@ void dither_to_Mono(QImageData *dst, const QImageData *src, Qt::ImageConversionF const uchar *qt_get_bitflip_array(); Q_GUI_EXPORT void qGamma_correct_back_to_linear_cs(QImage *image); -#if defined(_M_ARM) // QTBUG-42038 +#if defined(_M_ARM) && defined(_MSC_VER) // QTBUG-42038 #pragma optimize("", off) #endif inline int qt_depthForFormat(QImage::Format format) @@ -222,7 +222,7 @@ inline int qt_depthForFormat(QImage::Format format) return depth; } -#if defined(_M_ARM) +#if defined(_M_ARM) && defined(_MSC_VER) #pragma optimize("", on) #endif