[vlc-devel] [PATCH 3.0 04/41] contrib: qt: Update to Qt 5.11.0

Steve Lhomme robux4 at ycbcr.xyz
Tue Jul 7 15:11:03 CEST 2020


From: Martin Storsjö <martin at martin.st>

This allows dropping most of the local patches.

(cherry picked from commit 3ad1521475a1f3a811cfa23f7026918f192c5fef) (edited)

edited:
- removed upstreamed patches to build with Clang

Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
---
 ...ment-calculation-of-window-frames_56.patch | 271 ------------
 ...r-lower-value-when-rounding-fractio.patch} |  15 +-
 ...-Disable-systray-notification-sounds.patch |  27 ++
 ...-EnableNonClientDpiScaling-for-Wi_56.patch | 135 ------
 ...t-command-line-length-when-not-actua.patch |  75 ----
 ...zz-Fix-building-for-win64-with-clang.patch |  35 --
 ...taticMetaObject-with-the-highest-use.patch | 103 -----
 ...07-Only-define-QT_FASTCALL-on-x86_32.patch |  36 --
 ...drawhelpers-on-windows-just-like-on-.patch |  39 --
 ...n32-clang-g-mkspec-for-clang-targeti.patch | 234 ----------
 ...xx-macros-for-post-C-11-feature-test.patch | 159 -------
 ...railing-ZeroBits-Use-__builtin_clzs-.patch |  54 ---
 ...12-Remove-_bit_scan_-forward-reverse.patch | 418 ------------------
 ...mpilation-with-trunk-clang-for-mingw.patch |  40 --
 contrib/src/qt/SHA512SUMS                     |   2 +-
 contrib/src/qt/rules.mak                      |  32 +-
 contrib/src/qt/systray-no-sound.patch         |  13 -
 17 files changed, 46 insertions(+), 1642 deletions(-)
 delete mode 100644 contrib/src/qt/0001-Windows-QPA-Reimplement-calculation-of-window-frames_56.patch
 rename contrib/src/qt/{0003-QPA-prefer-lower-value-when-rounding-fractional-scaling.patch => 0001-Windows-QPA-prefer-lower-value-when-rounding-fractio.patch} (62%)
 create mode 100644 contrib/src/qt/0002-Windows-QPA-Disable-systray-notification-sounds.patch
 delete mode 100644 contrib/src/qt/0002-Windows-QPA-Use-new-EnableNonClientDpiScaling-for-Wi_56.patch
 delete mode 100644 contrib/src/qt/0004-qmake-don-t-limit-command-line-length-when-not-actua.patch
 delete mode 100644 contrib/src/qt/0005-harfbuzz-Fix-building-for-win64-with-clang.patch
 delete mode 100644 contrib/src/qt/0006-moc-Initialize-staticMetaObject-with-the-highest-use.patch
 delete mode 100644 contrib/src/qt/0007-Only-define-QT_FASTCALL-on-x86_32.patch
 delete mode 100644 contrib/src/qt/0008-Skip-arm-pixman-drawhelpers-on-windows-just-like-on-.patch
 delete mode 100644 contrib/src/qt/0009-mkspecs-Add-a-win32-clang-g-mkspec-for-clang-targeti.patch
 delete mode 100644 contrib/src/qt/0010-Add-the-QT_HAS_xxx-macros-for-post-C-11-feature-test.patch
 delete mode 100644 contrib/src/qt/0011-qCount-Leading-Trailing-ZeroBits-Use-__builtin_clzs-.patch
 delete mode 100644 contrib/src/qt/0012-Remove-_bit_scan_-forward-reverse.patch
 delete mode 100644 contrib/src/qt/0013-qsimd-Fix-compilation-with-trunk-clang-for-mingw.patch
 delete mode 100644 contrib/src/qt/systray-no-sound.patch

diff --git a/contrib/src/qt/0001-Windows-QPA-Reimplement-calculation-of-window-frames_56.patch b/contrib/src/qt/0001-Windows-QPA-Reimplement-calculation-of-window-frames_56.patch
deleted file mode 100644
index f958f2bc56..0000000000
--- a/contrib/src/qt/0001-Windows-QPA-Reimplement-calculation-of-window-frames_56.patch
+++ /dev/null
@@ -1,271 +0,0 @@
-From 81ead1ff68711fed609cb47b33b3906c14ed95d5 Mon Sep 17 00:00:00 2001
-From: Friedemann Kleint <Friedemann.Kleint at qt.io>
-Date: Mon, 14 Nov 2016 16:08:51 +0100
-Subject: [PATCH 1/2] Windows QPA: Reimplement calculation of window frames
-
-Instead of relying on AdjustWindowRectEx() and dirty-handling,
-capture the rectangles before and after the processing of
-WM_NCCALCSIZE and calculate the frame from that. This allows
-for changing window frames by handling WM_NCCALCSIZE and
-monitor-dependent window frames when using High DPI scaling.
-
-Task-number: QTBUG-53255
-Task-number: QTBUG-40578
-Task-number: QTBUG-56591
-Change-Id: If8364a5440a6324ea5d470bf5b74e68942285abe
-Reviewed-by: Tim Jenssen <tim.jenssen at qt.io>
-Reviewed-by: Oliver Wolff <oliver.wolff at qt.io>
----
- src/plugins/platforms/windows/qwindowscontext.cpp | 66 +++++++++++++++++++++--
- src/plugins/platforms/windows/qwindowscontext.h   |  4 +-
- src/plugins/platforms/windows/qwindowswindow.cpp  | 30 ++++-------
- src/plugins/platforms/windows/qwindowswindow.h    |  2 +-
- 4 files changed, 74 insertions(+), 28 deletions(-)
-
-diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
-index b611843..9058993 100644
---- a/src/plugins/platforms/windows/qwindowscontext.cpp
-+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
-@@ -453,6 +453,11 @@ void QWindowsContext::setWindowCreationContext(const QSharedPointer<QWindowCreat
-     d->m_creationContext = ctx;
- }
- 
-+QSharedPointer<QWindowCreationContext> QWindowsContext::windowCreationContext() const
-+{
-+    return d->m_creationContext;
-+}
-+
- int QWindowsContext::defaultDPI() const
- {
-     return d->m_defaultDPI;
-@@ -916,7 +921,9 @@ static inline QWindowsInputContext *windowsInputContext()
- 
- bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
-                                   QtWindows::WindowsEventType et,
--                                  WPARAM wParam, LPARAM lParam, LRESULT *result)
-+                                  WPARAM wParam, LPARAM lParam,
-+                                  LRESULT *result,
-+                                  QWindowsWindow **platformWindowPtr)
- {
-     *result = 0;
- 
-@@ -949,6 +956,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
-     }
- 
-     QWindowsWindow *platformWindow = findPlatformWindow(hwnd);
-+    *platformWindowPtr = platformWindow;
-     if (platformWindow) {
-         filterResult = 0;
-         if (QWindowSystemInterface::handleNativeEvent(platformWindow->window(), d->m_eventType, &msg, &filterResult)) {
-@@ -1144,9 +1152,6 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
-         return true;
-     case QtWindows::ThemeChanged: {
-         // Switch from Aero to Classic changes margins.
--        const Qt::WindowFlags flags = platformWindow->window()->flags();
--        if ((flags & Qt::WindowType_Mask) != Qt::Desktop && !(flags & Qt::FramelessWindowHint))
--            platformWindow->setFlag(QWindowsWindow::FrameDirty);
-         if (QWindowsTheme *theme = QWindowsTheme::instance())
-             theme->windowsThemeChanged(platformWindow->window());
-         return true;
-@@ -1318,6 +1323,37 @@ QTouchDevice *QWindowsContext::touchDevice() const
-     return d->m_mouseHandler.touchDevice();
- }
- 
-+static inline bool isEmptyRect(const RECT &rect)
-+{
-+    return rect.right - rect.left == 0 && rect.bottom - rect.top == 0;
-+}
-+
-+static inline QMargins marginsFromRects(const RECT &frame, const RECT &client)
-+{
-+    return QMargins(client.left - frame.left, client.top - frame.top,
-+                    frame.right - client.right, frame.bottom - client.bottom);
-+}
-+
-+static RECT rectFromNcCalcSize(UINT message, WPARAM wParam, LPARAM lParam, int n)
-+{
-+    RECT result = {0, 0, 0, 0};
-+    if (message == WM_NCCALCSIZE && wParam)
-+        result = reinterpret_cast<const NCCALCSIZE_PARAMS *>(lParam)->rgrc[n];
-+    return result;
-+}
-+
-+static inline bool isMinimized(HWND hwnd)
-+{
-+    WINDOWPLACEMENT windowPlacement;
-+    windowPlacement.length = sizeof(WINDOWPLACEMENT);
-+    return GetWindowPlacement(hwnd, &windowPlacement) && windowPlacement.showCmd == SW_SHOWMINIMIZED;
-+}
-+
-+static inline bool isTopLevel(HWND hwnd)
-+{
-+    return (GetWindowLongPtr(hwnd, GWL_STYLE) & WS_CHILD) == 0;
-+}
-+
- /*!
-     \brief Windows functions for actual windows.
- 
-@@ -1331,7 +1367,9 @@ extern "C" LRESULT QT_WIN_CALLBACK qWindowsWndProc(HWND hwnd, UINT message, WPAR
- {
-     LRESULT result;
-     const QtWindows::WindowsEventType et = windowsEventType(message, wParam, lParam);
--    const bool handled = QWindowsContext::instance()->windowsProc(hwnd, message, et, wParam, lParam, &result);
-+    QWindowsWindow *platformWindow = nullptr;
-+    const RECT ncCalcSizeFrame = rectFromNcCalcSize(message, wParam, lParam, 0);
-+    const bool handled = QWindowsContext::instance()->windowsProc(hwnd, message, et, wParam, lParam, &result, &platformWindow);
-     if (QWindowsContext::verbose > 1 && lcQpaEvents().isDebugEnabled()) {
-         if (const char *eventName = QWindowsGuiEventDispatcher::windowsMessageName(message)) {
-             qCDebug(lcQpaEvents) << "EVENT: hwd=" << hwnd << eventName << hex << "msg=0x"  << message
-@@ -1341,6 +1379,24 @@ extern "C" LRESULT QT_WIN_CALLBACK qWindowsWndProc(HWND hwnd, UINT message, WPAR
-     }
-     if (!handled)
-         result = DefWindowProc(hwnd, message, wParam, lParam);
-+
-+    // Capture WM_NCCALCSIZE on top level windows and obtain the window margins by
-+    // subtracting the rectangles before and after processing. This will correctly
-+    // capture client code overriding the message and allow for per-monitor margins
-+    // for High DPI (QTBUG-53255, QTBUG-40578).
-+    if (message == WM_NCCALCSIZE && !isEmptyRect(ncCalcSizeFrame) && isTopLevel(hwnd) && !isMinimized(hwnd)) {
-+        const QMargins margins =
-+            marginsFromRects(ncCalcSizeFrame, rectFromNcCalcSize(message, wParam, lParam, 0));
-+        if (margins.left() >= 0) {
-+            if (platformWindow) {
-+                platformWindow->setFrameMargins(margins);
-+            } else {
-+                const QSharedPointer<QWindowCreationContext> ctx = QWindowsContext::instance()->windowCreationContext();
-+                if (!ctx.isNull())
-+                    ctx->margins = margins;
-+            }
-+        }
-+    }
-     return result;
- }
- 
-diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h
-index 14baec9..dcac77c 100644
---- a/src/plugins/platforms/windows/qwindowscontext.h
-+++ b/src/plugins/platforms/windows/qwindowscontext.h
-@@ -210,12 +210,14 @@ public:
- 
-     inline bool windowsProc(HWND hwnd, UINT message,
-                             QtWindows::WindowsEventType et,
--                            WPARAM wParam, LPARAM lParam, LRESULT *result);
-+                            WPARAM wParam, LPARAM lParam, LRESULT *result,
-+                            QWindowsWindow **platformWindowPtr);
- 
-     QWindow *keyGrabber() const;
-     void setKeyGrabber(QWindow *hwnd);
- 
-     void setWindowCreationContext(const QSharedPointer<QWindowCreationContext> &ctx);
-+    QSharedPointer<QWindowCreationContext> windowCreationContext() const;
- 
-     void setTabletAbsoluteRange(int a);
-     void setProcessDpiAwareness(QtWindows::ProcessDpiAwareness dpiAwareness);
-diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
-index b38d7c2..11ba9c1 100644
---- a/src/plugins/platforms/windows/qwindowswindow.cpp
-+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
-@@ -1630,7 +1630,6 @@ QWindowsWindowData QWindowsWindow::setWindowFlags_sys(Qt::WindowFlags wt,
-     QWindowsWindowData result = m_data;
-     result.flags = creationData.flags;
-     result.embedded = creationData.embedded;
--    setFlag(FrameDirty);
-     return result;
- }
- 
-@@ -1638,7 +1637,6 @@ void QWindowsWindow::handleWindowStateChange(Qt::WindowState state)
- {
-     qCDebug(lcQpaWindows) << __FUNCTION__ << this << window()
-                  << "\n    from " << m_windowState << " to " << state;
--    setFlag(FrameDirty);
-     m_windowState = state;
-     QWindowSystemInterface::handleWindowStateChanged(window(), state);
-     switch (state) {
-@@ -1715,8 +1713,6 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
- 
-     const bool visible = isVisible();
- 
--    setFlag(FrameDirty);
--
-     if ((oldState == Qt::WindowFullScreen) != (newState == Qt::WindowFullScreen)) {
- #ifdef Q_OS_WINCE
-         HWND handle = FindWindow(L"HHTaskBar", L"");
-@@ -1826,7 +1822,6 @@ void QWindowsWindow::setStyle(unsigned s) const
- {
-     qCDebug(lcQpaWindows) << __FUNCTION__ << this << window() << debugWinStyle(s);
-     setFlag(WithinSetStyle);
--    setFlag(FrameDirty);
-     SetWindowLongPtr(m_data.hwnd, GWL_STYLE, s);
-     clearFlag(WithinSetStyle);
- }
-@@ -1835,7 +1830,6 @@ void QWindowsWindow::setExStyle(unsigned s) const
- {
-     qCDebug(lcQpaWindows).nospace() << __FUNCTION__ << ' ' << this << ' ' << window()
-         << " 0x" << QByteArray::number(s, 16);
--    setFlag(FrameDirty);
-     SetWindowLongPtr(m_data.hwnd, GWL_EXSTYLE, s);
- }
- 
-@@ -1909,22 +1903,17 @@ bool QWindowsWindow::handleGeometryChanging(MSG *message) const
-     return QWindowsWindow::handleGeometryChangingMessage(message, window(), margins);
- }
- 
--QMargins QWindowsWindow::frameMargins() const
-+void QWindowsWindow::setFrameMargins(const QMargins &newMargins)
- {
--    // Frames are invalidated by style changes (window state, flags).
--    // As they are also required for geometry calculations in resize
--    // event sequences, introduce a dirty flag mechanism to be able
--    // to cache results.
--    if (testFlag(FrameDirty)) {
--        // Always skip calculating style-dependent margins for windows claimed to be frameless.
--        // This allows users to remove the margins by handling WM_NCCALCSIZE with WS_THICKFRAME set
--        // to ensure Areo snap still works (QTBUG-40578).
--        m_data.frame = m_data.flags & Qt::FramelessWindowHint
--            ? QMargins(0, 0, 0, 0)
--            : QWindowsGeometryHint::frame(style(), exStyle());
--        clearFlag(FrameDirty);
-+    if (m_data.frame != newMargins) {
-+        qCDebug(lcQpaWindows) << __FUNCTION__ << window() <<  m_data.frame  << "->" << newMargins;
-+        m_data.frame = newMargins;
-     }
--    return m_data.frame + m_data.customMargins;
-+}
-+
-+QMargins QWindowsWindow::frameMargins() const
-+{
-+    return m_data.frame;
- }
- 
- void QWindowsWindow::setOpacity(qreal level)
-@@ -2322,7 +2311,6 @@ void QWindowsWindow::setCustomMargins(const QMargins &newCustomMargins)
-         const QPoint topLeft = currentFrameGeometry.topLeft();
-         QRect newFrame = currentFrameGeometry.marginsRemoved(oldCustomMargins) + m_data.customMargins;
-         newFrame.moveTo(topLeft);
--        setFlag(FrameDirty);
-         qCDebug(lcQpaWindows) << __FUNCTION__ << oldCustomMargins << "->" << newCustomMargins
-             << currentFrameGeometry << "->" << newFrame;
-         SetWindowPos(m_data.hwnd, 0, newFrame.x(), newFrame.y(), newFrame.width(), newFrame.height(), SWP_NOZORDER | SWP_FRAMECHANGED);
-diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
-index 6fffa1e..0e150a8 100644
---- a/src/plugins/platforms/windows/qwindowswindow.h
-+++ b/src/plugins/platforms/windows/qwindowswindow.h
-@@ -119,7 +119,6 @@ public:
-     {
-         AutoMouseCapture = 0x1, //! Automatic mouse capture on button press.
-         WithinSetParent = 0x2,
--        FrameDirty = 0x4,            //! Frame outdated by setStyle, recalculate in next query.
-         OpenGLSurface = 0x10,
-         OpenGL_ES2 = 0x20,
-         OpenGLDoubleBuffered = 0x40,
-@@ -177,6 +176,7 @@ public:
-     static bool handleGeometryChangingMessage(MSG *message, const QWindow *qWindow, const QMargins &marginsDp);
-     bool handleGeometryChanging(MSG *message) const;
-     QMargins frameMargins() const Q_DECL_OVERRIDE;
-+    void setFrameMargins(const QMargins &newMargins);
- 
-     void setOpacity(qreal level) Q_DECL_OVERRIDE;
-     void setMask(const QRegion &region) Q_DECL_OVERRIDE;
--- 
-2.9.0.windows.1
-
diff --git a/contrib/src/qt/0003-QPA-prefer-lower-value-when-rounding-fractional-scaling.patch b/contrib/src/qt/0001-Windows-QPA-prefer-lower-value-when-rounding-fractio.patch
similarity index 62%
rename from contrib/src/qt/0003-QPA-prefer-lower-value-when-rounding-fractional-scaling.patch
rename to contrib/src/qt/0001-Windows-QPA-prefer-lower-value-when-rounding-fractio.patch
index 6721e73d0b..100e8033f0 100644
--- a/contrib/src/qt/0003-QPA-prefer-lower-value-when-rounding-fractional-scaling.patch
+++ b/contrib/src/qt/0001-Windows-QPA-prefer-lower-value-when-rounding-fractio.patch
@@ -1,25 +1,26 @@
-From 169f145af591e78c3edc68a5a02130c8fd0973c5 Mon Sep 17 00:00:00 2001
+From cf632f7a1a3a36b91d16ac9019620434ebda9e24 Mon Sep 17 00:00:00 2001
 From: VideoLAN Buildbot <buildbot at videolan.org>
 Date: Tue, 13 Feb 2018 09:31:44 +0000
-Subject: [PATCH] Windows QPA: prefer lower value when rounding fractional scaling
+Subject: [PATCH 1/2] Windows QPA: prefer lower value when rounding fractional
+ scaling
 
 ---
  src/plugins/platforms/windows/qwindowsscreen.cpp | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp
-index 5accbe8..9b4cd55 100644
+index d56dc870ea..51c321f867 100644
 --- a/src/plugins/platforms/windows/qwindowsscreen.cpp
 +++ b/src/plugins/platforms/windows/qwindowsscreen.cpp
-@@ -258,7 +258,7 @@ qreal QWindowsScreen::pixelDensity() const
+@@ -260,7 +260,7 @@ qreal QWindowsScreen::pixelDensity() const
      // the pixel density since it is reflects the Windows UI scaling.
      // High DPI auto scaling should be disabled when the user chooses
      // small fonts on a High DPI monitor, resulting in lower logical DPI.
--    return qRound(logicalDpi().first / 96);
-+    return ceil(logicalDpi().first / 96. - 0.5);
+-    return qMax(1, qRound(logicalDpi().first / 96));
++    return qMax(1., ceil(logicalDpi().first / 96. - 0.5));
  }
  
  /*!
 -- 
-2.11.0
+2.15.2 (Apple Git-101.1)
 
diff --git a/contrib/src/qt/0002-Windows-QPA-Disable-systray-notification-sounds.patch b/contrib/src/qt/0002-Windows-QPA-Disable-systray-notification-sounds.patch
new file mode 100644
index 0000000000..f7d48681ca
--- /dev/null
+++ b/contrib/src/qt/0002-Windows-QPA-Disable-systray-notification-sounds.patch
@@ -0,0 +1,27 @@
+From f76248e9c67927d3a403b43ff941f72117e427f0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Hugo=20Beauz=C3=A9e-Luyssen?= <hugo at beauzee.fr>
+Date: Fri, 15 Jun 2018 09:59:42 +0300
+Subject: [PATCH 2/2] Windows QPA: Disable systray notification sounds
+
+---
+ src/plugins/platforms/windows/qwindowssystemtrayicon.cpp | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp b/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp
+index 901d132ea5..c30fa0e76d 100644
+--- a/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp
++++ b/src/plugins/platforms/windows/qwindowssystemtrayicon.cpp
+@@ -279,6 +279,10 @@ void QWindowsSystemTrayIcon::showMessage(const QString &title, const QString &me
+         }
+         tnd.hBalloonIcon = qt_pixmapToWinHICON(pm);
+     }
++
++    // Never play audio on notifications.
++    tnd.dwInfoFlags |= NIIF_NOSOUND;
++
+     tnd.hWnd = m_hwnd;
+     tnd.uTimeout = msecsIn <= 0 ?  UINT(10000) : UINT(msecsIn); // 10s default
+     tnd.uFlags = NIF_INFO | NIF_SHOWTIP;
+-- 
+2.15.2 (Apple Git-101.1)
+
diff --git a/contrib/src/qt/0002-Windows-QPA-Use-new-EnableNonClientDpiScaling-for-Wi_56.patch b/contrib/src/qt/0002-Windows-QPA-Use-new-EnableNonClientDpiScaling-for-Wi_56.patch
deleted file mode 100644
index ff7986dd29..0000000000
--- a/contrib/src/qt/0002-Windows-QPA-Use-new-EnableNonClientDpiScaling-for-Wi_56.patch
+++ /dev/null
@@ -1,135 +0,0 @@
-From 8f39b5247c4f7766553131688f5d5b7193327336 Mon Sep 17 00:00:00 2001
-From: Friedemann Kleint <Friedemann.Kleint at qt.io>
-Date: Mon, 7 Nov 2016 14:22:37 +0100
-Subject: [PATCH 2/2] Windows QPA: Use new EnableNonClientDpiScaling() for
- Windows decoration
-
-Use newly introduced EnableNonClientDpiScaling() function to fix
-the decoration having the wrong size in multimonitor setups with
-per-monitor DPI awareness.
-
-Task-number: QTBUG-53255
-Change-Id: Ic6e2f2a92f790259107d2a0837b96177cf3adb5f
-Reviewed-by: Tim Jenssen <tim.jenssen at qt.io>
----
- src/plugins/platforms/windows/qtwindowsglobal.h   |  3 ++
- src/plugins/platforms/windows/qwindowscontext.cpp | 35 ++++++++++++++++++++++-
- src/plugins/platforms/windows/qwindowscontext.h   |  7 +++++
- 3 files changed, 44 insertions(+), 1 deletion(-)
-
-diff --git a/src/plugins/platforms/windows/qtwindowsglobal.h b/src/plugins/platforms/windows/qtwindowsglobal.h
-index 63c083d..e7e010d 100644
---- a/src/plugins/platforms/windows/qtwindowsglobal.h
-+++ b/src/plugins/platforms/windows/qtwindowsglobal.h
-@@ -87,6 +87,7 @@ enum WindowsEventType // Simplify event types
-     TouchEvent = TouchEventFlag + 1,
-     NonClientMouseEvent = NonClientEventFlag + MouseEventFlag + 1,
-     NonClientHitTest = NonClientEventFlag + 2,
-+    NonClientCreate = NonClientEventFlag + 3,
-     KeyEvent = KeyEventFlag + 1,
-     KeyDownEvent = KeyEventFlag + KeyDownEventFlag + 1,
-     KeyboardLayoutChangeEvent = KeyEventFlag + 2,
-@@ -164,6 +165,8 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI
-         return QtWindows::HideEvent;
-     case WM_SIZE:
-         return QtWindows::ResizeEvent;
-+    case WM_NCCREATE:
-+        return QtWindows::NonClientCreate;
-     case WM_NCCALCSIZE:
-         return QtWindows::CalculateSize;
- #ifndef Q_OS_WINCE
-diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
-index 9058993..ab0b3da 100644
---- a/src/plugins/platforms/windows/qwindowscontext.cpp
-+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
-@@ -140,6 +140,28 @@ static inline QWindowsSessionManager *platformSessionManager() {
- }
- #endif
- 
-+static inline int windowDpiAwareness(HWND hwnd)
-+{
-+    return QWindowsContext::user32dll.getWindowDpiAwarenessContext && QWindowsContext::user32dll.getWindowDpiAwarenessContext
-+        ? QWindowsContext::user32dll.getAwarenessFromDpiAwarenessContext(QWindowsContext::user32dll.getWindowDpiAwarenessContext(hwnd))
-+        : -1;
-+}
-+
-+// Note: This only works within WM_NCCREATE
-+static bool enableNonClientDpiScaling(HWND hwnd)
-+{
-+    bool result = false;
-+    if (QWindowsContext::user32dll.enableNonClientDpiScaling && windowDpiAwareness(hwnd) == 2) {
-+        result = QWindowsContext::user32dll.enableNonClientDpiScaling(hwnd) != FALSE;
-+        if (!result) {
-+            const DWORD errorCode = GetLastError();
-+            qErrnoWarning(int(errorCode), "EnableNonClientDpiScaling() failed for HWND %p (%lu)",
-+                          hwnd, errorCode);
-+        }
-+    }
-+    return result;
-+}
-+
- /*!
-     \class QWindowsUser32DLL
-     \brief Struct that contains dynamically resolved symbols of User32.dll.
-@@ -165,7 +187,8 @@ QWindowsUser32DLL::QWindowsUser32DLL() :
-     registerTouchWindow(0), unregisterTouchWindow(0),
-     getTouchInputInfo(0), closeTouchInputHandle(0), setProcessDPIAware(0),
-     addClipboardFormatListener(0), removeClipboardFormatListener(0),
--    getDisplayAutoRotationPreferences(0), setDisplayAutoRotationPreferences(0)
-+    getDisplayAutoRotationPreferences(0), setDisplayAutoRotationPreferences(0),
-+    enableNonClientDpiScaling(0), getWindowDpiAwarenessContext(0), getAwarenessFromDpiAwarenessContext(0)
- {
- }
- 
-@@ -188,6 +211,12 @@ void QWindowsUser32DLL::init()
-     }
-     getDisplayAutoRotationPreferences = (GetDisplayAutoRotationPreferences)library.resolve("GetDisplayAutoRotationPreferences");
-     setDisplayAutoRotationPreferences = (SetDisplayAutoRotationPreferences)library.resolve("SetDisplayAutoRotationPreferences");
-+
-+    if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS10) { // Appears in 10.0.14393, October 2016
-+        enableNonClientDpiScaling = (EnableNonClientDpiScaling)library.resolve("EnableNonClientDpiScaling");
-+        getWindowDpiAwarenessContext = (GetWindowDpiAwarenessContext)library.resolve("GetWindowDpiAwarenessContext");
-+        getAwarenessFromDpiAwarenessContext = (GetAwarenessFromDpiAwarenessContext)library.resolve("GetAwarenessFromDpiAwarenessContext");
-+    }
- }
- 
- bool QWindowsUser32DLL::initTouch()
-@@ -1040,6 +1069,10 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
-         case QtWindows::MoveEvent:
-             d->m_creationContext->obtainedGeometry.moveTo(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
-             return true;
-+        case QtWindows::NonClientCreate:
-+            if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS10 && d->m_creationContext->window->isTopLevel())
-+                enableNonClientDpiScaling(msg.hwnd);
-+            return false;
-         case QtWindows::CalculateSize:
-             return QWindowsGeometryHint::handleCalculateSize(d->m_creationContext->customMargins, msg, result);
-         case QtWindows::GeometryChangingEvent:
-diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h
-index dcac77c..156ede5 100644
---- a/src/plugins/platforms/windows/qwindowscontext.h
-+++ b/src/plugins/platforms/windows/qwindowscontext.h
-@@ -96,6 +96,9 @@ struct QWindowsUser32DLL
-     typedef BOOL (WINAPI *RemoveClipboardFormatListener)(HWND);
-     typedef BOOL (WINAPI *GetDisplayAutoRotationPreferences)(DWORD *);
-     typedef BOOL (WINAPI *SetDisplayAutoRotationPreferences)(DWORD);
-+    typedef BOOL (WINAPI *EnableNonClientDpiScaling)(HWND);
-+    typedef int  (WINAPI *GetWindowDpiAwarenessContext)(HWND);
-+    typedef int  (WINAPI *GetAwarenessFromDpiAwarenessContext)(int);
- 
-     // Functions missing in Q_CC_GNU stub libraries.
-     SetLayeredWindowAttributes setLayeredWindowAttributes;
-@@ -122,6 +125,10 @@ struct QWindowsUser32DLL
-     // Rotation API
-     GetDisplayAutoRotationPreferences getDisplayAutoRotationPreferences;
-     SetDisplayAutoRotationPreferences setDisplayAutoRotationPreferences;
-+
-+    EnableNonClientDpiScaling enableNonClientDpiScaling;
-+    GetWindowDpiAwarenessContext getWindowDpiAwarenessContext;
-+    GetAwarenessFromDpiAwarenessContext getAwarenessFromDpiAwarenessContext;
- };
- 
- struct QWindowsShell32DLL
--- 
-2.9.0.windows.1
-
diff --git a/contrib/src/qt/0004-qmake-don-t-limit-command-line-length-when-not-actua.patch b/contrib/src/qt/0004-qmake-don-t-limit-command-line-length-when-not-actua.patch
deleted file mode 100644
index 5654d7421a..0000000000
--- a/contrib/src/qt/0004-qmake-don-t-limit-command-line-length-when-not-actua.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-From 767c2a2e339babcff9383d539f59479586444dd5 Mon Sep 17 00:00:00 2001
-From: Oswald Buddenhagen <oswald.buddenhagen at qt.io>
-Date: Mon, 7 Aug 2017 12:17:06 +0200
-Subject: [PATCH 4/9] qmake: don't limit command line length when not actually
- on windows
-
-QMAKE_LINK_OBJECT_MAX is actually a property of the host, not the
-target.
-
-this works around binutil's inability to use thin LTO objects in
-conjunction with an MRI script
-(https://sourceware.org/bugzilla/show_bug.cgi?id=21702).
-
-Task-number: QTBUG-61335
-Change-Id: I90a1334b9c905c433b35546e8f3f3b5089d2c65b
-Reviewed-by: Jake Petroules <jake.petroules at qt.io>
-Backport-Of: 8bebded9ab02b8eec67c44bfddf802d6bf9cda3c (v5.9.2)
-
-qmake: Handle QMAKE_LINK_OBJECT_MAX being unset for static libraries
-
-This was missed in 8bebded9.
-
-Task-number: QTBUG-63637
-Change-Id: I6be472430a9aa8f533def4fd6c14c8dbfe8b6f70
-Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen at qt.io>
-Backport-Of: 8cef809b16aac9d4c4163ff2e2e831adf70133c2 (v5.10.1)
----
- mkspecs/win32-g++/qmake.conf          | 6 ++++--
- qmake/generators/win32/mingw_make.cpp | 6 ++++--
- 2 files changed, 8 insertions(+), 4 deletions(-)
-
-diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf
-index 2576a58e83..68d773499c 100644
---- a/mkspecs/win32-g++/qmake.conf
-+++ b/mkspecs/win32-g++/qmake.conf
-@@ -87,8 +87,10 @@ QMAKE_LFLAGS_CXX11      =
- QMAKE_LFLAGS_CXX14      =
- QMAKE_LFLAGS_CXX1Z      =
- QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections
--QMAKE_LINK_OBJECT_MAX   = 10
--QMAKE_LINK_OBJECT_SCRIPT = object_script
-+equals(QMAKE_HOST.os, Windows) {
-+    QMAKE_LINK_OBJECT_MAX = 10
-+    QMAKE_LINK_OBJECT_SCRIPT = object_script
-+}
- QMAKE_PREFIX_SHLIB      =
- QMAKE_EXTENSION_SHLIB   = dll
- QMAKE_PREFIX_STATICLIB  = lib
-diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp
-index 96fd24cd31..c1609027f3 100644
---- a/qmake/generators/win32/mingw_make.cpp
-+++ b/qmake/generators/win32/mingw_make.cpp
-@@ -284,7 +284,8 @@ void MingwMakefileGenerator::writeLibsPart(QTextStream &t)
- 
- void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
- {
--    if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) {
-+    const ProString &objmax = project->first("QMAKE_LINK_OBJECT_MAX");
-+    if (objmax.isEmpty() || project->values("OBJECTS").count() < objmax.toInt()) {
-         objectsLinkLine = "$(OBJECTS)";
-     } else if (project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
-         QString ar_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
-@@ -323,7 +324,8 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
-     if(!project->isEmpty("QMAKE_PRE_LINK"))
-         t << "\n\t" <<var("QMAKE_PRE_LINK");
-     if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
--        if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) {
-+        const ProString &objmax = project->first("QMAKE_LINK_OBJECT_MAX");
-+        if (objmax.isEmpty() || project->values("OBJECTS").count() < objmax.toInt()) {
-             t << "\n\t$(LIB) $(DESTDIR_TARGET) " << objectsLinkLine << " " ;
-         } else {
-             t << "\n\t" << objectsLinkLine << " " ;
--- 
-2.14.3 (Apple Git-98)
-
diff --git a/contrib/src/qt/0005-harfbuzz-Fix-building-for-win64-with-clang.patch b/contrib/src/qt/0005-harfbuzz-Fix-building-for-win64-with-clang.patch
deleted file mode 100644
index feade28fbe..0000000000
--- a/contrib/src/qt/0005-harfbuzz-Fix-building-for-win64-with-clang.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 43c31ab3146e144eb1938211803476a8fb3e44f2 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
-Date: Sat, 11 Nov 2017 16:59:11 +0200
-Subject: [PATCH 5/9] harfbuzz: Fix building for win64 with clang
-
-Clang errors out on casting from a pointer to a smaller integer
-type.
-
-This is an adapted backport of a newer upstream harfbuzz
-commit, 03b7a221f701a9b003890878e730ad175c3fdd86.
-
-Change-Id: I0de62d90008021aed6acf4e946ce1d346f9aac8c
-Reviewed-by: Friedemann Kleint <Friedemann.Kleint at qt.io>
-Reviewed-by: Konstantin Ritt <ritt.ks at gmail.com>
-Backport-Of: f663c83f9d08f21bf6d96405456bd5864422b173 (v5.10.1)
----
- src/3rdparty/harfbuzz-ng/src/hb-private.hh | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/3rdparty/harfbuzz-ng/src/hb-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-private.hh
-index 53e0510a92..5170a8f393 100644
---- a/src/3rdparty/harfbuzz-ng/src/hb-private.hh
-+++ b/src/3rdparty/harfbuzz-ng/src/hb-private.hh
-@@ -671,7 +671,7 @@ _hb_debug_msg_va (const char *what,
-   fprintf (stderr, "%-10s", what ? what : "");
- 
-   if (obj)
--    fprintf (stderr, "(%0*lx) ", (unsigned int) (2 * sizeof (void *)), (unsigned long) obj);
-+    fprintf (stderr, "(%*p) ", (unsigned int) (2 * sizeof (void *)), obj);
-   else
-     fprintf (stderr, " %*s  ", (unsigned int) (2 * sizeof (void *)), "");
- 
--- 
-2.14.3 (Apple Git-98)
-
diff --git a/contrib/src/qt/0006-moc-Initialize-staticMetaObject-with-the-highest-use.patch b/contrib/src/qt/0006-moc-Initialize-staticMetaObject-with-the-highest-use.patch
deleted file mode 100644
index bb94b148b5..0000000000
--- a/contrib/src/qt/0006-moc-Initialize-staticMetaObject-with-the-highest-use.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From 4cc1f128c4b9894b94ffdd5d0a32257ead7a9cf5 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
-Date: Fri, 24 Nov 2017 10:10:23 +0200
-Subject: [PATCH 6/9] moc: Initialize staticMetaObject with the highest
- user-settable priority
-
-The referenced static meta object for the superclass might be in a
-different DLL. In this case, the whole QMetaObject can't be initialized
-all via preinitialized data in the data section of the binary, but must
-run code at runtime to fill in the value of the dllimported pointer.
-
-In these cases, both GCC and MSVC initialize as much as possible statically,
-while only filling in the dllimported values (QMetaObject::d::superdata)
-at runtime. Clang, on the other side, initializes the whole struct
-at runtime if some part of it needs runtime initialization, leaving
-the struct completely uninitialized before constructors are run.
-
-In C++, there are no guarantees for in what order constructors in
-different translation units are executed. This in particular means
-that there are no guarantees as to whether qRegisterWidgetsVariant()
-in qwidgetsvariants.cpp runs before or after the runtime initialization
-of QWidget::staticMetaObject.
-
-With GCC and MSVC, this doesn't seem to have mattered since only the
-superdata pointer of the staticMetaObject was uninitialized - everything
-else was initialized, and the superdata pointer doesn't seem to be
-accessed during qRegisterWidgetsVariant.
-
-With clang, the whole staticMetaObject is uninitialized, unless the
-staticMetaObject has been initialized before (and the initialization
-order is undefined).
-
-By setting a manual priority (which is a GCC extension that also
-clang supports) for the staticMetaObjects, we can be sure that
-these are initialized before the actual explicit constructor
-invocations (without any explicit initialization priority) that
-can access the staticMetaObjects.
-
-Change-Id: I64a82f12d690528567509791bae088b6304e189b
-Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart at woboq.com>
-Backport-Of: 74118a4784569046d5fdf5e08c99f8b1b43e9710 (v5.10.1)
-
-moc: Only use the init_priority attribute when targeting windows
-
-While both GCC and the GCC compatible clang support this attribute in
-general, GCC doesn't support it when targeting macOS, ending up with
-errors like these:
-error: 'init_priority' attribute is not supported on this platform
-
-This error isn't a property of the platform itself though, since
-clang supports the attribute just fine on macOS.
-
-The attribute is only used to work around an issue with dllimport
-on windows, so limit its use to that platform, to avoid issues
-with it potentially being unsupported on platforms other than
-macOS as well.
-
-This fixes compiling with GCC for macOS.
-
-Change-Id: I0235e6365635d73233951566c10ad869b26a0fc6
-Reviewed-by: Thiago Macieira <thiago.macieira at intel.com>
-Backport-Of: b97765efd452921f75c1d04820c4b5e9e9d49100 (5.11 branch)
----
- src/corelib/global/qglobal.h | 6 ++++++
- src/tools/moc/generator.cpp  | 4 ++--
- 2 files changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
-index 4528005177..3a3f8d40da 100644
---- a/src/corelib/global/qglobal.h
-+++ b/src/corelib/global/qglobal.h
-@@ -499,6 +499,12 @@ typedef qptrdiff qintptr;
- #  define Q_ALWAYS_INLINE inline
- #endif
- 
-+#if defined(Q_CC_GNU) && defined(Q_OS_WIN)
-+#  define QT_INIT_METAOBJECT __attribute__((init_priority(101)))
-+#else
-+#  define QT_INIT_METAOBJECT
-+#endif
-+
- //defines the type for the WNDPROC on windows
- //the alignment needs to be forced for sse2 to not crash with mingw
- #if defined(Q_OS_WIN)
-diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
-index 99629f0427..8cbeb4ce78 100644
---- a/src/tools/moc/generator.cpp
-+++ b/src/tools/moc/generator.cpp
-@@ -525,9 +525,9 @@ void Generator::generateCode()
- // Finally create and initialize the static meta object
- //
-     if (isQt)
--        fprintf(out, "const QMetaObject QObject::staticQtMetaObject = {\n");
-+        fprintf(out, "QT_INIT_METAOBJECT const QMetaObject QObject::staticQtMetaObject = {\n");
-     else
--        fprintf(out, "const QMetaObject %s::staticMetaObject = {\n", cdef->qualified.constData());
-+        fprintf(out, "QT_INIT_METAOBJECT const QMetaObject %s::staticMetaObject = {\n", cdef->qualified.constData());
- 
-     if (isQObject)
-         fprintf(out, "    { Q_NULLPTR, ");
--- 
-2.14.3 (Apple Git-98)
-
diff --git a/contrib/src/qt/0007-Only-define-QT_FASTCALL-on-x86_32.patch b/contrib/src/qt/0007-Only-define-QT_FASTCALL-on-x86_32.patch
deleted file mode 100644
index a300b35997..0000000000
--- a/contrib/src/qt/0007-Only-define-QT_FASTCALL-on-x86_32.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From abaeb37bc3c7d18b0a74e0c932c9767f074d01d7 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
-Date: Sat, 11 Nov 2017 16:59:31 +0200
-Subject: [PATCH 7/9] Only define QT_FASTCALL on x86_32
-
-The __fastcall calling convention is silently ignored on other
-architectures. The GNU attribute regparm is allowed but doesn't
-make sense on x86_64. On other architectures, the attribute isn't
-supported at all.
-
-This fixes building with clang for MinGW/ARM and ARM64.
-
-Change-Id: Ice1c6eadd0e90b2e5e34736542ee49a25dc67fe6
-Reviewed-by: Lars Knoll <lars.knoll at qt.io>
-Reviewed-by: Thiago Macieira <thiago.macieira at intel.com>
-Backport-Of: bfc96c9c0e103c4fcfda25b9a6eaa80f4f19fba1 (v5.10.1)
----
- src/corelib/global/qglobal.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
-index 3523a38ebd..fe59804796 100644
---- a/src/corelib/global/qglobal.h
-+++ b/src/corelib/global/qglobal.h
-@@ -463,7 +463,7 @@ typedef qptrdiff qintptr;
- #  define QT_ASCII_CAST_WARN
- #endif
- 
--#if defined(__i386__) || defined(_WIN32) || defined(_WIN32_WCE)
-+#ifdef Q_PROCESSOR_X86_32
- #  if defined(Q_CC_GNU)
- #    define QT_FASTCALL __attribute__((regparm(3)))
- #  elif defined(Q_CC_MSVC)
--- 
-2.14.3 (Apple Git-98)
-
diff --git a/contrib/src/qt/0008-Skip-arm-pixman-drawhelpers-on-windows-just-like-on-.patch b/contrib/src/qt/0008-Skip-arm-pixman-drawhelpers-on-windows-just-like-on-.patch
deleted file mode 100644
index 67f1b6ab17..0000000000
--- a/contrib/src/qt/0008-Skip-arm-pixman-drawhelpers-on-windows-just-like-on-.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From b8ce2e4e77afb42bdb440440e55fe6dbbb5c5851 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
-Date: Sat, 6 Jan 2018 00:37:48 +0200
-Subject: [PATCH 8/9] Skip arm pixman drawhelpers on windows just like on ios
-
-Windows on arm (which uses clang, or msvc, but no gcc is available for
-that setup) can't assemble these sources.
-
-(On linux, builds with clang force deferring it to the external
-assembler, but for windows on arm, no gas compatible external
-assembler is available).
-
-Change-Id: I139572257884cfdc57d3c32061a8c2e28c6e24de
-Reviewed-by: Allan Sandfeld Jensen <allan.jensen at qt.io>
-Backport-Of: 8072c36eebd0648770e0f17fae408f33cb371c02 (v5.10.1)
-
-On revisions after 90f79db90a8db5b872040346bd58a27140b6a7a3 (v5.7.0),
-one also needs to backport f7524d73e33d00c76e55d996cdd4ea841ac6b7fa
-(part of v5.10.1).
----
- src/gui/painting/painting.pri | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri
-index 1e516e4581..3fc3f1e3ef 100644
---- a/src/gui/painting/painting.pri
-+++ b/src/gui/painting/painting.pri
-@@ -104,7 +104,7 @@ AVX2_SOURCES += painting/qdrawhelper_avx2.cpp
- NEON_SOURCES += painting/qdrawhelper_neon.cpp
- NEON_HEADERS += painting/qdrawhelper_neon_p.h
- NEON_ASM += ../3rdparty/pixman/pixman-arm-neon-asm.S painting/qdrawhelper_neon_asm.S
--!ios:!contains(QT_ARCH, "arm64"): DEFINES += ENABLE_PIXMAN_DRAWHELPERS
-+!ios:!win32:!contains(QT_ARCH, "arm64"): DEFINES += ENABLE_PIXMAN_DRAWHELPERS
- 
- MIPS_DSP_SOURCES += painting/qdrawhelper_mips_dsp.cpp
- MIPS_DSP_HEADERS += painting/qdrawhelper_mips_dsp_p.h painting/qt_mips_asm_dsp_p.h
--- 
-2.14.3 (Apple Git-98)
-
diff --git a/contrib/src/qt/0009-mkspecs-Add-a-win32-clang-g-mkspec-for-clang-targeti.patch b/contrib/src/qt/0009-mkspecs-Add-a-win32-clang-g-mkspec-for-clang-targeti.patch
deleted file mode 100644
index 6ffcec7e89..0000000000
--- a/contrib/src/qt/0009-mkspecs-Add-a-win32-clang-g-mkspec-for-clang-targeti.patch
+++ /dev/null
@@ -1,234 +0,0 @@
-From a616c80783949d1164a4f6e79f4db2291aad834c Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
-Date: Wed, 24 Jan 2018 10:41:58 +0200
-Subject: [PATCH 9/9] mkspecs: Add a win32-clang-g++ mkspec, for clang
- targeting mingw, like g++
-
-Change-Id: I427e46e6c34c2beeb2a815f1af512e4e8bd213c2
-Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen at qt.io>
-Backport-Of: 96e3985963a20a84bb8ff7032d77531641512d1d (5.11 branch)
-
-This is an adapted backport, keeping win32-clang-g++ similar to
-win32-g++, with the following differences:
-
--QMAKE_COMPILER          = gcc
-+QMAKE_COMPILER          = gcc clang llvm   # clang pretends to be gcc
-
--QMAKE_CC                = $${CROSS_COMPILE}gcc
-+QMAKE_CC                = $${CROSS_COMPILE}clang
-
--QMAKE_CFLAGS            = -pipe -fno-keep-inline-dllexport
-+QMAKE_CFLAGS            = -pipe
-
--QMAKE_CFLAGS_WARN_ON    = -Wall -Wextra
-+QMAKE_CFLAGS_WARN_ON    = -Wall -Wextra -Wno-ignored-attributes
-
--QMAKE_CXX               = $${CROSS_COMPILE}g++
-+QMAKE_CXX               = $${CROSS_COMPILE}clang++
-
--QMAKE_LINK              = $${CROSS_COMPILE}g++
--QMAKE_LINK_C            = $${CROSS_COMPILE}gcc
-+QMAKE_LINK              = $${CROSS_COMPILE}clang++
-+QMAKE_LINK_C            = $${CROSS_COMPILE}clang
-
-On branches before Qt 5.9, configure also needs a change like this,
-to support a mingw mkspec with a different name than the existing:
--        case `basename "$XPLATFORM"` in win32-g++*)
-+        case `basename "$XPLATFORM"` in win32-*g++*)
-
-This isn't necessary any longer after
-ab0cc3055d3d1f0faa98f96a7e8ae58b6ef6461a, which became part of v5.9.0.
----
- configure                               |   2 +-
- mkspecs/win32-clang-g++/qmake.conf      | 118 ++++++++++++++++++++++++++++++++
- mkspecs/win32-clang-g++/qplatformdefs.h |  40 +++++++++++
- 3 files changed, 159 insertions(+), 1 deletion(-)
- create mode 100644 mkspecs/win32-clang-g++/qmake.conf
- create mode 100644 mkspecs/win32-clang-g++/qplatformdefs.h
-
-diff --git a/configure b/configure
-index 6ebeab30fe..fa0aae8300 100755
---- a/configure
-+++ b/configure
-@@ -1429,7 +1429,7 @@ while [ "$#" -gt 0 ]; do
-         ;;
-     xplatform)
-         XPLATFORM="$VAL"
--        case `basename "$XPLATFORM"` in win32-g++*)
-+        case `basename "$XPLATFORM"` in win32-*g++*)
-             XPLATFORM_MINGW=yes
-             CFG_RPATH=no
-             CFG_REDUCE_EXPORTS=no
-diff --git a/mkspecs/win32-clang-g++/qmake.conf b/mkspecs/win32-clang-g++/qmake.conf
-new file mode 100644
-index 0000000000..7673fd0549
---- /dev/null
-+++ b/mkspecs/win32-clang-g++/qmake.conf
-@@ -0,0 +1,118 @@
-+#
-+# qmake configuration for win32-clang-g++
-+#
-+# Written for MinGW-w64 / clang 6.0 or higher
-+#
-+# Cross compile example for x86_64-w64-mingw32-clang++:
-+#   configure -xplatform win32-clang-g++ -device-option CROSS_COMPILE=x86_64-w64-mingw32-
-+#
-+
-+load(device_config)
-+include(../common/angle.conf)
-+
-+MAKEFILE_GENERATOR      = MINGW
-+QMAKE_PLATFORM          = win32 mingw
-+CONFIG                 += debug_and_release debug_and_release_target precompile_header
-+DEFINES                += UNICODE
-+QMAKE_COMPILER_DEFINES += __GNUC__ WIN32
-+
-+QMAKE_EXT_OBJ           = .o
-+QMAKE_EXT_RES           = _res.o
-+
-+QMAKE_COMPILER          = gcc clang llvm   # clang pretends to be gcc
-+
-+QMAKE_CC                = $${CROSS_COMPILE}clang
-+QMAKE_LEX               = flex
-+QMAKE_LEXFLAGS          =
-+QMAKE_YACC              = bison -y
-+QMAKE_YACCFLAGS         = -d
-+QMAKE_CFLAGS            = -pipe
-+QMAKE_CFLAGS_DEPS       = -M
-+QMAKE_CFLAGS_WARN_ON    = -Wall -Wextra -Wno-ignored-attributes
-+QMAKE_CFLAGS_WARN_OFF   = -w
-+QMAKE_CFLAGS_RELEASE    = -O2
-+QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO = -O2 -g
-+QMAKE_CFLAGS_DEBUG      = -g
-+QMAKE_CFLAGS_YACC       = -Wno-unused -Wno-parentheses
-+QMAKE_CFLAGS_SPLIT_SECTIONS = -ffunction-sections
-+QMAKE_CFLAGS_SSE2       = -msse2 -mstackrealign
-+QMAKE_CFLAGS_SSE3       = -msse3
-+QMAKE_CFLAGS_SSSE3      = -mssse3
-+QMAKE_CFLAGS_SSE4_1     = -msse4.1
-+QMAKE_CFLAGS_SSE4_2     = -msse4.2
-+QMAKE_CFLAGS_AVX        = -mavx
-+QMAKE_CFLAGS_AVX2       = -mavx2
-+QMAKE_CFLAGS_NEON       = -mfpu=neon
-+
-+QMAKE_CXX               = $${CROSS_COMPILE}clang++
-+QMAKE_CXXFLAGS          = $$QMAKE_CFLAGS
-+QMAKE_CXXFLAGS_DEPS     = $$QMAKE_CFLAGS_DEPS
-+QMAKE_CXXFLAGS_WARN_ON  = $$QMAKE_CFLAGS_WARN_ON
-+QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
-+QMAKE_CXXFLAGS_RELEASE  = $$QMAKE_CFLAGS_RELEASE
-+QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
-+QMAKE_CXXFLAGS_DEBUG    = $$QMAKE_CFLAGS_DEBUG
-+QMAKE_CXXFLAGS_YACC     = $$QMAKE_CFLAGS_YACC
-+QMAKE_CXXFLAGS_THREAD   = $$QMAKE_CFLAGS_THREAD
-+QMAKE_CXXFLAGS_RTTI_ON  = -frtti
-+QMAKE_CXXFLAGS_RTTI_OFF = -fno-rtti
-+QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions -mthreads
-+QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -fno-exceptions
-+QMAKE_CXXFLAGS_CXX11    = -std=c++0x
-+QMAKE_CXXFLAGS_CXX14    = -std=c++1y
-+QMAKE_CXXFLAGS_CXX1Z    = -std=c++1z
-+QMAKE_CXXFLAGS_GNUCXX11 = -std=gnu++0x
-+QMAKE_CXXFLAGS_GNUCXX14 = -std=gnu++1y
-+QMAKE_CXXFLAGS_GNUCXX1Z = -std=gnu++1z
-+QMAKE_CXXFLAGS_SPLIT_SECTIONS = $$QMAKE_CFLAGS_SPLIT_SECTIONS
-+
-+QMAKE_INCDIR            =
-+
-+QMAKE_RUN_CC            = $(CC) -c $(CFLAGS) $(INCPATH) -o $obj $src
-+QMAKE_RUN_CC_IMP        = $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
-+QMAKE_RUN_CXX           = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
-+QMAKE_RUN_CXX_IMP       = $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
-+
-+QMAKE_LINK              = $${CROSS_COMPILE}clang++
-+QMAKE_LINK_C            = $${CROSS_COMPILE}clang
-+QMAKE_LFLAGS            =
-+QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads
-+QMAKE_LFLAGS_EXCEPTIONS_OFF =
-+QMAKE_LFLAGS_RELEASE    = -Wl,-s
-+QMAKE_LFLAGS_DEBUG      =
-+QMAKE_LFLAGS_CONSOLE    = -Wl,-subsystem,console
-+QMAKE_LFLAGS_WINDOWS    = -Wl,-subsystem,windows
-+QMAKE_LFLAGS_DLL        = -shared
-+QMAKE_LFLAGS_CXX11      =
-+QMAKE_LFLAGS_CXX14      =
-+QMAKE_LFLAGS_CXX1Z      =
-+QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections
-+equals(QMAKE_HOST.os, Windows) {
-+    QMAKE_LINK_OBJECT_MAX = 10
-+    QMAKE_LINK_OBJECT_SCRIPT = object_script
-+}
-+QMAKE_PREFIX_SHLIB      =
-+QMAKE_EXTENSION_SHLIB   = dll
-+QMAKE_PREFIX_STATICLIB  = lib
-+QMAKE_EXTENSION_STATICLIB = a
-+QMAKE_LIB_EXTENSIONS    = a dll.a
-+
-+QMAKE_LIBS              =
-+QMAKE_LIBS_CORE         = -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32
-+QMAKE_LIBS_GUI          = -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lws2_32 -lole32 -luuid -luser32 -ladvapi32
-+QMAKE_LIBS_NETWORK      = -lws2_32
-+QMAKE_LIBS_OPENGL       = -lglu32 -lopengl32 -lgdi32 -luser32
-+QMAKE_LIBS_OPENGL_ES2   = -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME} -lgdi32 -luser32
-+QMAKE_LIBS_OPENGL_ES2_DEBUG = -l$${LIBEGL_NAME}d -l$${LIBGLESV2_NAME}d -lgdi32 -luser32
-+QMAKE_LIBS_COMPAT       = -ladvapi32 -lshell32 -lcomdlg32 -luser32 -lgdi32 -lws2_32
-+QMAKE_LIBS_QT_ENTRY     = -lmingw32 -lqtmain
-+
-+QMAKE_IDL               = midl
-+QMAKE_LIB               = $${CROSS_COMPILE}ar -rc
-+QMAKE_RC                = $${CROSS_COMPILE}windres
-+
-+QMAKE_STRIP             = $${CROSS_COMPILE}strip
-+QMAKE_STRIPFLAGS_LIB   += --strip-unneeded
-+QMAKE_OBJCOPY           = $${CROSS_COMPILE}objcopy
-+QMAKE_NM                = $${CROSS_COMPILE}nm -P
-+load(qt_config)
-diff --git a/mkspecs/win32-clang-g++/qplatformdefs.h b/mkspecs/win32-clang-g++/qplatformdefs.h
-new file mode 100644
-index 0000000000..906e724c19
---- /dev/null
-+++ b/mkspecs/win32-clang-g++/qplatformdefs.h
-@@ -0,0 +1,40 @@
-+/****************************************************************************
-+**
-+** Copyright (C) 2018 The Qt Company Ltd.
-+** Contact: https://www.qt.io/licensing/
-+**
-+** This file is part of the qmake spec of the Qt Toolkit.
-+**
-+** $QT_BEGIN_LICENSE:LGPL$
-+** Commercial License Usage
-+** Licensees holding valid commercial Qt licenses may use this file in
-+** accordance with the commercial license agreement provided with the
-+** Software or, alternatively, in accordance with the terms contained in
-+** a written agreement between you and The Qt Company. For licensing terms
-+** and conditions see https://www.qt.io/terms-conditions. For further
-+** information use the contact form at https://www.qt.io/contact-us.
-+**
-+** GNU Lesser General Public License Usage
-+** Alternatively, this file may be used under the terms of the GNU Lesser
-+** General Public License version 3 as published by the Free Software
-+** Foundation and appearing in the file LICENSE.LGPL3 included in the
-+** packaging of this file. Please review the following information to
-+** ensure the GNU Lesser General Public License version 3 requirements
-+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-+**
-+** GNU General Public License Usage
-+** Alternatively, this file may be used under the terms of the GNU
-+** General Public License version 2.0 or (at your option) the GNU General
-+** Public license version 3 or any later version approved by the KDE Free
-+** Qt Foundation. The licenses are as published by the Free Software
-+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-+** included in the packaging of this file. Please review the following
-+** information to ensure the GNU General Public License requirements will
-+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-+** https://www.gnu.org/licenses/gpl-3.0.html.
-+**
-+** $QT_END_LICENSE$
-+**
-+****************************************************************************/
-+
-+#include "../win32-g++/qplatformdefs.h"
--- 
-2.14.3 (Apple Git-98)
-
diff --git a/contrib/src/qt/0010-Add-the-QT_HAS_xxx-macros-for-post-C-11-feature-test.patch b/contrib/src/qt/0010-Add-the-QT_HAS_xxx-macros-for-post-C-11-feature-test.patch
deleted file mode 100644
index 12d0717d79..0000000000
--- a/contrib/src/qt/0010-Add-the-QT_HAS_xxx-macros-for-post-C-11-feature-test.patch
+++ /dev/null
@@ -1,159 +0,0 @@
-From 35a0fcb2f7934189701a4a328d3d2896bda75d22 Mon Sep 17 00:00:00 2001
-From: Thiago Macieira <thiago.macieira at intel.com>
-Date: Wed, 1 Jul 2015 14:38:22 -0700
-Subject: [PATCH 10/13] Add the QT_HAS_xxx macros for post-C++11 feature
- testing
-
-And for compiler extensions. QT_HAS_BUILTIN and QT_HAS_ATTRIBUTE will
-come in handy.
-
-Change-Id: I255870833a024a36adf6ffff13ecf06624bfc1ef
-Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart at woboq.com>
-Backport-Of: 6f298be07681f4038ddd5694d259ef64a574ac6f (v5.7)
----
- src/corelib/global/qcompilerdetection.h | 31 +++++++++++++++++++++++++
- src/corelib/global/qendian.h            |  2 --
- src/corelib/global/qlogging.cpp         |  8 ++-----
- src/corelib/global/qnumeric_p.h         | 16 +++++--------
- 4 files changed, 39 insertions(+), 18 deletions(-)
-
-diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
-index 038ad03cb0..60c11003ba 100644
---- a/src/corelib/global/qcompilerdetection.h
-+++ b/src/corelib/global/qcompilerdetection.h
-@@ -1164,6 +1164,37 @@
- #  define QT_HAS_FEATURE(x)             0
- #endif
- 
-+/*
-+ * SG10's SD-6 feature detection and some useful extensions from Clang and GCC
-+ * https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations
-+ * http://clang.llvm.org/docs/LanguageExtensions.html#feature-checking-macros
-+ */
-+#ifdef __has_builtin
-+#  define QT_HAS_BUILTIN(x)             __has_builtin(x)
-+#else
-+#  define QT_HAS_BUILTIN(x)             0
-+#endif
-+#ifdef __has_attribute
-+#  define QT_HAS_ATTRIBUTE(x)           __has_attribute(x)
-+#else
-+#  define QT_HAS_ATTRIBUTE(x)           0
-+#endif
-+#ifdef __has_cpp_attribute
-+#  define QT_HAS_CPP_ATTRIBUTE(x)       __has_cpp_attribute(x)
-+#else
-+#  define QT_HAS_CPP_ATTRIBUTE(x)       0
-+#endif
-+#ifdef __has_include
-+#  define QT_HAS_INCLUDE(x)             __has_include(x)
-+#else
-+#  define QT_HAS_INCLUDE(x)             0
-+#endif
-+#ifdef __has_include_next
-+#  define QT_HAS_INCLUDE_NEXT(x)        __has_include_next(x)
-+#else
-+#  define QT_HAS_INCLUDE_NEXT(x)        0
-+#endif
-+
- /*
-  * Warning/diagnostic handling
-  */
-diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h
-index 23dda270e3..a678d567ae 100644
---- a/src/corelib/global/qendian.h
-+++ b/src/corelib/global/qendian.h
-@@ -164,8 +164,6 @@ template <> inline quint16 qbswap<quint16>(quint16 source)
- }
- #endif // GCC & Clang intrinsics
- 
--#undef QT_HAS_BUILTIN
--
- // signed specializations
- template <> inline qint64 qbswap<qint64>(qint64 source)
- {
-diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
-index 6b95449b3d..7c7adbec99 100644
---- a/src/corelib/global/qlogging.cpp
-+++ b/src/corelib/global/qlogging.cpp
-@@ -75,17 +75,13 @@
- # include "private/qcore_unix_p.h"
- #endif
- 
--#ifndef __has_include
--#  define __has_include(x) 0
--#endif
--
- #ifndef QT_BOOTSTRAPPED
- #if !defined QT_NO_REGULAREXPRESSION
- #  ifdef __UCLIBC__
- #    if __UCLIBC_HAS_BACKTRACE__
- #      define QLOGGING_HAVE_BACKTRACE
- #    endif
--#  elif (defined(__GLIBC__) && defined(__GLIBCXX__)) || (__has_include(<cxxabi.h>) && __has_include(<execinfo.h>))
-+#  elif (defined(__GLIBC__) && defined(__GLIBCXX__)) || (QT_HAS_INCLUDE(<cxxabi.h>) && QT_HAS_INCLUDE(<execinfo.h>))
- #    define QLOGGING_HAVE_BACKTRACE
- #  endif
- #endif
-@@ -94,7 +90,7 @@
- extern char *__progname;
- #endif
- 
--#if defined(Q_OS_LINUX) && (defined(__GLIBC__) || __has_include(<sys/syscall.h>))
-+#if defined(Q_OS_LINUX) && (defined(__GLIBC__) || QT_HAS_INCLUDE(<sys/syscall.h>))
- #  include <sys/syscall.h>
- 
- # if defined(Q_OS_ANDROID) && !defined(SYS_gettid)
-diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h
-index b18d521d05..c29ec0ea7b 100644
---- a/src/corelib/global/qnumeric_p.h
-+++ b/src/corelib/global/qnumeric_p.h
-@@ -56,10 +56,6 @@
- #  include <immintrin.h>    // for _addcarry_u<nn>
- #endif
- 
--#ifndef __has_builtin
--#  define __has_builtin(x)  0
--#endif
--
- QT_BEGIN_NAMESPACE
- 
- #if !defined(Q_CC_MIPS)
-@@ -230,28 +226,28 @@ mul_overflow(T v1, T v2, T *r)
- #endif
- 
- // GCC 5 and Clang have builtins to detect overflows
--#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || __has_builtin(__builtin_uadd_overflow)
-+#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || QT_HAS_BUILTIN(__builtin_uadd_overflow)
- template <> inline bool add_overflow(unsigned v1, unsigned v2, unsigned *r)
- { return __builtin_uadd_overflow(v1, v2, r); }
- #endif
--#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || __has_builtin(__builtin_uaddl_overflow)
-+#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || QT_HAS_BUILTIN(__builtin_uaddl_overflow)
- template <> inline bool add_overflow(unsigned long v1, unsigned long v2, unsigned long *r)
- { return __builtin_uaddl_overflow(v1, v2, r); }
- #endif
--#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || __has_builtin(__builtin_uaddll_overflow)
-+#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || QT_HAS_BUILTIN(__builtin_uaddll_overflow)
- template <> inline bool add_overflow(unsigned long long v1, unsigned long long v2, unsigned long long *r)
- { return __builtin_uaddll_overflow(v1, v2, r); }
- #endif
- 
--#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || __has_builtin(__builtin_umul_overflow)
-+#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || QT_HAS_BUILTIN(__builtin_umul_overflow)
- template <> inline bool mul_overflow(unsigned v1, unsigned v2, unsigned *r)
- { return __builtin_umul_overflow(v1, v2, r); }
- #endif
--#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || __has_builtin(__builtin_umull_overflow)
-+#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || QT_HAS_BUILTIN(__builtin_umull_overflow)
- template <> inline bool mul_overflow(unsigned long v1, unsigned long v2, unsigned long *r)
- { return __builtin_umull_overflow(v1, v2, r); }
- #endif
--#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || __has_builtin(__builtin_umulll_overflow)
-+#if (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 500) || QT_HAS_BUILTIN(__builtin_umulll_overflow)
- template <> inline bool mul_overflow(unsigned long long v1, unsigned long long v2, unsigned long long *r)
- { return __builtin_umulll_overflow(v1, v2, r); }
- #  define HAVE_MUL64_OVERFLOW
--- 
-2.21.1 (Apple Git-122.3)
-
diff --git a/contrib/src/qt/0011-qCount-Leading-Trailing-ZeroBits-Use-__builtin_clzs-.patch b/contrib/src/qt/0011-qCount-Leading-Trailing-ZeroBits-Use-__builtin_clzs-.patch
deleted file mode 100644
index 8ef4215d5a..0000000000
--- a/contrib/src/qt/0011-qCount-Leading-Trailing-ZeroBits-Use-__builtin_clzs-.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 88c0c1b2b5b5fb780afbe4a0b82adfe87c1a45a4 Mon Sep 17 00:00:00 2001
-From: Thiago Macieira <thiago.macieira at intel.com>
-Date: Thu, 3 Dec 2015 17:37:02 -0800
-Subject: [PATCH 11/13] qCount{Leading,Trailing}ZeroBits: Use __builtin_clzs
- for 16-bit
-
-If possible.
-
-The BSF/BSR/TZCNT/LZCNT Intel instruction does not exist for 8-bit. And
-it's a good idea to use the 32-bit instruction instead of the 16-bit one
-for that case, to avoid the Length Changing Prefix (LCP).
-
-GCC doesn't allow us to use __builtin_cl[tz]s unless BMI is active,
-while ICC generates the same code either way (Clang understands
-__has_builtin).
-
-Change-Id: I8de47ed6c7be4847b99bffff141c91603c7024dc
-Reviewed-by: Allan Sandfeld Jensen <allan.jensen at theqtcompany.com>
-Backport-Of: f5f47987ce369aa3f7553e6c0da509461a1ddf1a (v5.7)
----
- src/corelib/tools/qalgorithms.h | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/src/corelib/tools/qalgorithms.h b/src/corelib/tools/qalgorithms.h
-index 503f98feee..f066e5c28a 100644
---- a/src/corelib/tools/qalgorithms.h
-+++ b/src/corelib/tools/qalgorithms.h
-@@ -653,7 +653,11 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint8 v) Q_DECL_NOT
- Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint16 v) Q_DECL_NOTHROW
- {
- #if defined(Q_CC_GNU)
-+#  if QT_HAS_BUILTIN(__builtin_ctzs) || defined(__BMI__)
-+    return v ? __builtin_ctzs(v) : 16U;
-+#  else
-     return v ? __builtin_ctz(v) : 16U;
-+#  endif
- #else
-     unsigned int c = 16; // c will be the number of zero bits on the right
-     v &= -signed(v);
-@@ -712,7 +716,11 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint8 v) Q_DECL_NOTH
- Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint16 v) Q_DECL_NOTHROW
- {
- #if defined(Q_CC_GNU)
-+#  if QT_HAS_BUILTIN(__builtin_clzs) || defined(__BMI__)
-+    return v ? __builtin_clzs(v) : 16U;
-+#  else
-     return v ? __builtin_clz(v)-16U : 16U;
-+#  endif
- #else
-     v = v | (v >> 1);
-     v = v | (v >> 2);
--- 
-2.21.1 (Apple Git-122.3)
-
diff --git a/contrib/src/qt/0012-Remove-_bit_scan_-forward-reverse.patch b/contrib/src/qt/0012-Remove-_bit_scan_-forward-reverse.patch
deleted file mode 100644
index 2c067eeba8..0000000000
--- a/contrib/src/qt/0012-Remove-_bit_scan_-forward-reverse.patch
+++ /dev/null
@@ -1,418 +0,0 @@
-From 7f59c885535a7ba0c6271319759c3a853aedd55c Mon Sep 17 00:00:00 2001
-From: Erik Verbruggen <erik.verbruggen at theqtcompany.com>
-Date: Thu, 3 Dec 2015 12:50:44 +0100
-Subject: [PATCH 12/13] Remove _bit_scan_{forward,reverse}
-
-Use qCountTrailingZeroBits and qCountLeadingZeroBits from qalgorithms.h
-instead. Also extended these versions for MSVC. The _bit_scan_* versions
-stem from a time before the glorious days of qalgorithms.h. A big
-advantage is that these functions can be used on all platforms.
-
-Change-Id: I5a1b886371520310a7fe16e617635ea335046beb
-Reviewed-by: Simon Hausmann <simon.hausmann at qt.io>
-Backport-Of: e70324f8dd1f191556599cf60100dd0ad0b16708 (v5.8)
----
- src/corelib/codecs/qutfcodec.cpp |  16 +++-
- src/corelib/kernel/qmath.h       |  22 ++---
- src/corelib/tools/qalgorithms.h  | 139 +++++++++++++++++++++++++------
- src/corelib/tools/qsimd_p.h      |  43 ----------
- src/corelib/tools/qstring.cpp    |   8 +-
- 5 files changed, 144 insertions(+), 84 deletions(-)
-
-diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp
-index 476990fb7a..f82d999501 100644
---- a/src/corelib/codecs/qutfcodec.cpp
-+++ b/src/corelib/codecs/qutfcodec.cpp
-@@ -47,6 +47,16 @@ enum { Endian = 0, Data = 1 };
- static const uchar utf8bom[] = { 0xef, 0xbb, 0xbf };
- 
- #if defined(__SSE2__) && defined(QT_COMPILER_SUPPORTS_SSE2)
-+static Q_ALWAYS_INLINE uint qBitScanReverse(unsigned v) Q_DECL_NOTHROW
-+{
-+    uint result = qCountLeadingZeroBits(v);
-+    // Now Invert the result: clz will count *down* from the msb to the lsb, so the msb index is 31
-+    // and the lsb index is 0. The result for _bit_scan_reverse is expected to be the index when
-+    // counting up: msb index is 0 (because it starts there), and the lsb index is 31.
-+    result ^= sizeof(unsigned) * 8 - 1;
-+    return result;
-+}
-+
- static inline bool simdEncodeAscii(uchar *&dst, const ushort *&nextAscii, const ushort *&src, const ushort *end)
- {
-     // do sixteen characters at a time
-@@ -75,9 +85,9 @@ static inline bool simdEncodeAscii(uchar *&dst, const ushort *&nextAscii, const
-             // find the next probable ASCII character
-             // we don't want to load 32 bytes again in this loop if we know there are non-ASCII
-             // characters still coming
--            nextAscii = src + _bit_scan_reverse(n) + 1;
-+            nextAscii = src + qBitScanReverse(n) + 1;
- 
--            n = _bit_scan_forward(n);
-+            n = qCountTrailingZeroBits(n);
-             dst += n;
-             src += n;
-             return false;
-@@ -126,7 +136,7 @@ static inline bool simdDecodeAscii(ushort *&dst, const uchar *&nextAscii, const
-         // find the next probable ASCII character
-         // we don't want to load 16 bytes again in this loop if we know there are non-ASCII
-         // characters still coming
--        n = _bit_scan_reverse(n);
-+        n = qBitScanReverse(n);
-         nextAscii = src + (n / BitSpacing) + 1;
-         return false;
- 
-diff --git a/src/corelib/kernel/qmath.h b/src/corelib/kernel/qmath.h
-index e60561c05f..d52895175f 100644
---- a/src/corelib/kernel/qmath.h
-+++ b/src/corelib/kernel/qmath.h
-@@ -39,6 +39,7 @@
- #endif
- 
- #include <QtCore/qglobal.h>
-+#include <QtCore/qalgorithms.h>
- 
- #ifndef _USE_MATH_DEFINES
- #  define _USE_MATH_DEFINES
-@@ -235,20 +236,12 @@ Q_DECL_CONSTEXPR inline double qRadiansToDegrees(double radians)
- }
- 
- 
--#if defined(Q_CC_GNU)
--// clz instructions exist in at least MIPS, ARM, PowerPC and X86, so we can assume this builtin always maps to an efficient instruction.
-+#if defined(QT_HAS_BUILTIN_CLZ)
- inline quint32 qNextPowerOfTwo(quint32 v)
- {
-     if (v == 0)
-         return 1;
--    return 2U << (31 ^ __builtin_clz(v));
--}
--
--inline quint64 qNextPowerOfTwo(quint64 v)
--{
--    if (v == 0)
--        return 1;
--    return Q_UINT64_C(2) << (63 ^ __builtin_clzll(v));
-+    return 2U << (31 ^ QAlgorithmsPrivate::qt_builtin_clz(v));
- }
- #else
- inline quint32 qNextPowerOfTwo(quint32 v)
-@@ -261,7 +254,16 @@ inline quint32 qNextPowerOfTwo(quint32 v)
-     ++v;
-     return v;
- }
-+#endif
- 
-+#if defined(QT_HAS_BUILTIN_CLZLL)
-+inline quint64 qNextPowerOfTwo(quint64 v)
-+{
-+    if (v == 0)
-+        return 1;
-+    return Q_UINT64_C(2) << (63 ^ QAlgorithmsPrivate::qt_builtin_clzll(v));
-+}
-+#else
- inline quint64 qNextPowerOfTwo(quint64 v)
- {
-     v |= v >> 1;
-diff --git a/src/corelib/tools/qalgorithms.h b/src/corelib/tools/qalgorithms.h
-index f066e5c28a..66b30e81a5 100644
---- a/src/corelib/tools/qalgorithms.h
-+++ b/src/corelib/tools/qalgorithms.h
-@@ -549,6 +549,105 @@ QT_DEPRECATED_X("Use std::binary_search") Q_OUTOFLINE_TEMPLATE RandomAccessItera
- 
- #endif // QT_DEPRECATED_SINCE(5, 2)
- 
-+// Clang had a bug where __builtin_ctz/clz is not marked as constexpr.
-+#if defined Q_CC_CLANG && defined __apple_build_version__ &&  __clang_major__ < 7
-+#  undef QT_HAS_CONSTEXPR_BUILTIN_CTZ_CLZ
-+#else
-+#  define QT_HAS_CONSTEXPR_BUILTIN_CTZ_CLZ
-+#endif
-+
-+#if defined QT_HAS_CONSTEXPR_BUILTIN_CTZ_CLZ
-+#if defined(Q_CC_GNU)
-+#  define QT_HAS_BUILTIN_CTZS
-+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) Q_DECL_NOTHROW
-+{
-+#  if QT_HAS_BUILTIN(__builtin_ctzs) || defined(__BMI__)
-+    return __builtin_ctzs(v);
-+#  else
-+    return __builtin_ctz(v);
-+#  endif
-+}
-+#define QT_HAS_BUILTIN_CLZS
-+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) Q_DECL_NOTHROW
-+{
-+#  if QT_HAS_BUILTIN(__builtin_clzs) || defined(__BMI__)
-+    return __builtin_clzs(v);
-+#  else
-+    return __builtin_clz(v) - 16U;
-+#  endif
-+}
-+#define QT_HAS_BUILTIN_CTZ
-+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctz(quint32 v) Q_DECL_NOTHROW
-+{
-+    return __builtin_ctz(v);
-+}
-+#define QT_HAS_BUILTIN_CLZ
-+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clz(quint32 v) Q_DECL_NOTHROW
-+{
-+    return __builtin_clz(v);
-+}
-+#define QT_HAS_BUILTIN_CTZLL
-+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzll(quint64 v) Q_DECL_NOTHROW
-+{
-+    return __builtin_ctzll(v);
-+}
-+#define QT_HAS_BUILTIN_CLZLL
-+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clzll(quint64 v) Q_DECL_NOTHROW
-+{
-+    return __builtin_clzll(v);
-+}
-+#elif defined(Q_CC_MSVC) && !defined(Q_OS_WINCE)
-+#define QT_HAS_BUILTIN_CTZ
-+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_ctz(quint32 val)
-+{
-+    unsigned long result;
-+    _BitScanForward(&result, val);
-+    return result;
-+}
-+#define QT_HAS_BUILTIN_CLZ
-+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_clz(quint32 val)
-+{
-+    unsigned long result;
-+    _BitScanReverse(&result, val);
-+    // Now Invert the result: clz will count *down* from the msb to the lsb, so the msb index is 31
-+    // and the lsb index is 0. The result for the index when counting up: msb index is 0 (because it
-+    // starts there), and the lsb index is 31.
-+    result ^= sizeof(quint32) * 8 - 1;
-+    return result;
-+}
-+#if Q_PROCESSOR_WORDSIZE == 8
-+// These are only defined for 64bit builds.
-+#define QT_HAS_BUILTIN_CTZLL
-+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_ctzll(quint64 val)
-+{
-+    unsigned long result;
-+    _BitScanForward64(&result, val);
-+    return result;
-+}
-+// MSVC calls it _BitScanReverse and returns the carry flag, which we don't need
-+#define QT_HAS_BUILTIN_CLZLL
-+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE unsigned long qt_builtin_clzll(quint64 val)
-+{
-+    unsigned long result;
-+    _BitScanReverse64(&result, val);
-+    // see qt_builtin_clz
-+    result ^= sizeof(quint64) * 8 - 1;
-+    return result;
-+}
-+#endif
-+#  define QT_HAS_BUILTIN_CTZS
-+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_ctzs(quint16 v) Q_DECL_NOTHROW
-+{
-+    return qt_builtin_ctz(v);
-+}
-+#define QT_HAS_BUILTIN_CLZS
-+Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_builtin_clzs(quint16 v) Q_DECL_NOTHROW
-+{
-+    return qt_builtin_clz(v) - 16U;
-+}
-+#endif
-+#endif // QT_HAS_CONSTEXPR_BUILTIN_CTZ_CLZ
-+
- } //namespace QAlgorithmsPrivate
- 
- 
-@@ -619,8 +718,8 @@ Q_DECL_CONST_FUNCTION Q_DECL_CONSTEXPR inline uint qPopulationCount(long unsigne
- 
- Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint32 v) Q_DECL_NOTHROW
- {
--#if defined(Q_CC_GNU)
--    return v ? __builtin_ctz(v) : 32U;
-+#if defined(QT_HAS_BUILTIN_CTZ)
-+    return v ? QAlgorithmsPrivate::qt_builtin_ctz(v) : 32U;
- #else
-     // see http://graphics.stanford.edu/~seander/bithacks.html#ZerosOnRightParallel
-     unsigned int c = 32; // c will be the number of zero bits on the right
-@@ -637,8 +736,8 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint32 v) Q_DECL_NO
- 
- Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint8 v) Q_DECL_NOTHROW
- {
--#if defined(Q_CC_GNU)
--    return v ? __builtin_ctz(v) : 8U;
-+#if defined(QT_HAS_BUILTIN_CTZ)
-+    return v ? QAlgorithmsPrivate::qt_builtin_ctz(v) : 8U;
- #else
-     unsigned int c = 8; // c will be the number of zero bits on the right
-     v &= -signed(v);
-@@ -652,12 +751,8 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint8 v) Q_DECL_NOT
- 
- Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint16 v) Q_DECL_NOTHROW
- {
--#if defined(Q_CC_GNU)
--#  if QT_HAS_BUILTIN(__builtin_ctzs) || defined(__BMI__)
--    return v ? __builtin_ctzs(v) : 16U;
--#  else
--    return v ? __builtin_ctz(v) : 16U;
--#  endif
-+#if defined(QT_HAS_BUILTIN_CTZS)
-+    return v ? QAlgorithmsPrivate::qt_builtin_ctzs(v) : 16U;
- #else
-     unsigned int c = 16; // c will be the number of zero bits on the right
-     v &= -signed(v);
-@@ -672,8 +767,8 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint16 v) Q_DECL_NO
- 
- Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(quint64 v) Q_DECL_NOTHROW
- {
--#if defined(Q_CC_GNU)
--    return v ? __builtin_ctzll(v) : 64;
-+#if defined(QT_HAS_BUILTIN_CTZLL)
-+    return v ? QAlgorithmsPrivate::qt_builtin_ctzll(v) : 64;
- #else
-     quint32 x = static_cast<quint32>(v);
-     return x ? qCountTrailingZeroBits(x)
-@@ -688,8 +783,8 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountTrailingZeroBits(unsigned long v) Q_D
- 
- Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint32 v) Q_DECL_NOTHROW
- {
--#if defined(Q_CC_GNU)
--    return v ? __builtin_clz(v) : 32U;
-+#if defined(QT_HAS_BUILTIN_CLZ)
-+    return v ? QAlgorithmsPrivate::qt_builtin_clz(v) : 32U;
- #else
-     // Hacker's Delight, 2nd ed. Fig 5-16, p. 102
-     v = v | (v >> 1);
-@@ -703,8 +798,8 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint32 v) Q_DECL_NOT
- 
- Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint8 v) Q_DECL_NOTHROW
- {
--#if defined(Q_CC_GNU)
--    return v ? __builtin_clz(v)-24U : 8U;
-+#if defined(QT_HAS_BUILTIN_CLZ)
-+    return v ? QAlgorithmsPrivate::qt_builtin_clz(v)-24U : 8U;
- #else
-     v = v | (v >> 1);
-     v = v | (v >> 2);
-@@ -715,12 +810,8 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint8 v) Q_DECL_NOTH
- 
- Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint16 v) Q_DECL_NOTHROW
- {
--#if defined(Q_CC_GNU)
--#  if QT_HAS_BUILTIN(__builtin_clzs) || defined(__BMI__)
--    return v ? __builtin_clzs(v) : 16U;
--#  else
--    return v ? __builtin_clz(v)-16U : 16U;
--#  endif
-+#if defined(QT_HAS_BUILTIN_CLZS)
-+    return v ? QAlgorithmsPrivate::qt_builtin_clzs(v) : 16U;
- #else
-     v = v | (v >> 1);
-     v = v | (v >> 2);
-@@ -732,8 +823,8 @@ Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint16 v) Q_DECL_NOT
- 
- Q_DECL_RELAXED_CONSTEXPR inline uint qCountLeadingZeroBits(quint64 v) Q_DECL_NOTHROW
- {
--#if defined(Q_CC_GNU)
--    return v ? __builtin_clzll(v) : 64U;
-+#if defined(QT_HAS_BUILTIN_CLZLL)
-+    return v ? QAlgorithmsPrivate::qt_builtin_clzll(v) : 64U;
- #else
-     v = v | (v >> 1);
-     v = v | (v >> 2);
-diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h
-index d689654b29..ff1fe34eb9 100644
---- a/src/corelib/tools/qsimd_p.h
-+++ b/src/corelib/tools/qsimd_p.h
-@@ -430,49 +430,6 @@ static inline quint64 qCpuFeatures()
- #define qCpuHasFeature(feature)     ((qCompilerCpuFeatures & (Q_UINT64_C(1) << CpuFeature ## feature)) \
-                                      || (qCpuFeatures() & (Q_UINT64_C(1) << CpuFeature ## feature)))
- 
--#ifdef Q_PROCESSOR_X86
--// Bit scan functions for x86
--#  if defined(Q_CC_MSVC)
--#    if defined _WIN32_WCE && _WIN32_WCE < 0x800
--extern "C" unsigned char _BitScanForward(unsigned long* Index, unsigned long Mask);
--extern "C" unsigned char _BitScanReverse(unsigned long* Index, unsigned long Mask);
--#       pragma intrinsic(_BitScanForward)
--#       pragma intrinsic(_BitScanReverse)
--#    endif
--// MSVC calls it _BitScanReverse and returns the carry flag, which we don't need
--static __forceinline unsigned long _bit_scan_reverse(uint val)
--{
--    unsigned long result;
--    _BitScanReverse(&result, val);
--    return result;
--}
--static __forceinline unsigned long _bit_scan_forward(uint val)
--{
--    unsigned long result;
--    _BitScanForward(&result, val);
--    return result;
--}
--#  elif (defined(Q_CC_CLANG) || (defined(Q_CC_GNU) && Q_CC_GNU < 405)) \
--    && !defined(Q_CC_INTEL)
--// Clang is missing the intrinsic for _bit_scan_reverse
--// GCC only added it in version 4.5
--static inline __attribute__((always_inline))
--unsigned _bit_scan_reverse(unsigned val)
--{
--    unsigned result;
--    asm("bsr %1, %0" : "=r" (result) : "r" (val));
--    return result;
--}
--static inline __attribute__((always_inline))
--unsigned _bit_scan_forward(unsigned val)
--{
--    unsigned result;
--    asm("bsf %1, %0" : "=r" (result) : "r" (val));
--    return result;
--}
--#  endif
--#endif // Q_PROCESSOR_X86
--
- #define ALIGNMENT_PROLOGUE_16BYTES(ptr, i, length) \
-     for (; i < static_cast<int>(qMin(static_cast<quintptr>(length), ((4 - ((reinterpret_cast<quintptr>(ptr) >> 2) & 0x3)) & 0x3))); ++i)
- 
-diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
-index 645d213d82..85f70a3e34 100644
---- a/src/corelib/tools/qstring.cpp
-+++ b/src/corelib/tools/qstring.cpp
-@@ -464,7 +464,7 @@ static int ucstrncmp(const QChar *a, const QChar *b, int l)
-         uint mask = ~_mm_movemask_epi8(result);
-         if (ushort(mask)) {
-             // found a different byte
--            uint idx = uint(_bit_scan_forward(mask));
-+            uint idx = qCountTrailingZeroBits(mask);
-             return reinterpret_cast<const QChar *>(ptr + idx)->unicode()
-                     - reinterpret_cast<const QChar *>(ptr + distance + idx)->unicode();
-         }
-@@ -565,7 +565,7 @@ static int ucstrncmp(const QChar *a, const uchar *c, int l)
- #  endif
-         if (mask) {
-             // found a different character
--            uint idx = uint(_bit_scan_forward(mask));
-+            uint idx = qCountTrailingZeroBits(mask);
-             return uc[offset + idx / 2] - c[offset + idx / 2];
-         }
-     }
-@@ -583,7 +583,7 @@ static int ucstrncmp(const QChar *a, const uchar *c, int l)
-         uint mask = ~_mm_movemask_epi8(result);
-         if (ushort(mask)) {
-             // found a different character
--            uint idx = uint(_bit_scan_forward(mask));
-+            uint idx = qCountTrailingZeroBits(mask);
-             return uc[offset + idx / 2] - c[offset + idx / 2];
-         }
- 
-@@ -678,7 +678,7 @@ static int findChar(const QChar *str, int len, QChar ch, int from,
-                     // found a match
-                     // same as: return n - s + _bit_scan_forward(mask) / 2
-                     return (reinterpret_cast<const char *>(n) - reinterpret_cast<const char *>(s)
--                            + _bit_scan_forward(mask)) >> 1;
-+                            + qCountTrailingZeroBits(mask)) >> 1;
-                 }
-             }
- 
--- 
-2.21.1 (Apple Git-122.3)
-
diff --git a/contrib/src/qt/0013-qsimd-Fix-compilation-with-trunk-clang-for-mingw.patch b/contrib/src/qt/0013-qsimd-Fix-compilation-with-trunk-clang-for-mingw.patch
deleted file mode 100644
index ea59dbf474..0000000000
--- a/contrib/src/qt/0013-qsimd-Fix-compilation-with-trunk-clang-for-mingw.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 4d7a9efed1a3e65b1ec0232140a707fdf2458493 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
-Date: Fri, 18 Jan 2019 09:31:10 +0200
-Subject: [PATCH 13/13] qsimd: Fix compilation with trunk clang for mingw
-
-Current tip-of-tree clang (after Clang 8 was branched) added an
-intrinsic function __builtin_ia32_xgetbv, and added the following
-define that provides _xgetbv:
-    #define _xgetbv(A) __builtin_ia32_xgetbv((long long)(A))
-
-This fallback declaration of the _xgetbv function only is used
-in case the Q_OS_WIN branch of the #if/#elif below is used, if
-the #if (defined(Q_CC_GNU) && !defined(Q_CC_EMSCRIPTEN)) ||
-defined(Q_CC_GHS) wasn't taken. I left out the
-!defined(Q_CC_EMSCRIPTEN) part as I believe Q_OS_WIN and
-Q_CC_EMSCRIPTEN are mutually exclusive.
-
-Change-Id: I257fc4283ff9f0845df51ab764cf58acdf285c66
-Reviewed-by: Thiago Macieira <thiago.macieira at intel.com>
-Backport-Of: 9818af7d436f7aa1bf5c635041cc5d08fec599b5 (v5.12.2)
----
- src/corelib/tools/qsimd.cpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
-index 334e37b674..4316496ae2 100644
---- a/src/corelib/tools/qsimd.cpp
-+++ b/src/corelib/tools/qsimd.cpp
-@@ -226,7 +226,7 @@ static void cpuidFeatures07_00(uint &ebx, uint &ecx)
- #endif
- }
- 
--#ifdef Q_OS_WIN
-+#if defined(Q_OS_WIN) && !(defined(Q_CC_GNU) || defined(Q_CC_GHS))
- // fallback overload in case this intrinsic does not exist: unsigned __int64 _xgetbv(unsigned int);
- inline quint64 _xgetbv(__int64) { return 0; }
- #endif
--- 
-2.21.1 (Apple Git-122.3)
-
diff --git a/contrib/src/qt/SHA512SUMS b/contrib/src/qt/SHA512SUMS
index 54d29615d1..4cd02df10c 100644
--- a/contrib/src/qt/SHA512SUMS
+++ b/contrib/src/qt/SHA512SUMS
@@ -1 +1 @@
-19b505b6afb394a85dd27decf892fb7dccef89d33a41df458a9905d32a6dde23e76c11db9214bfaa7d9bddf48959d1579fad217d96d85333fdac94608c46389c  qt-5.6.3.tar.xz
+9f68e00d432db6999f932da6ba759e465ea7d65461ef8db13765f16bd812f2ddd05beede1df3c6546165bc4924a6bd14cc0ff083defc43e2dce37ea20c561462  qt-5.11.0.tar.xz
diff --git a/contrib/src/qt/rules.mak b/contrib/src/qt/rules.mak
index 5d87e797e8..1738dd0c3d 100644
--- a/contrib/src/qt/rules.mak
+++ b/contrib/src/qt/rules.mak
@@ -1,7 +1,7 @@
 # Qt
 
-QT_VERSION := 5.6.3
-QT_URL := https://download.qt.io/archive/qt/5.6/$(QT_VERSION)/submodules/qtbase-opensource-src-$(QT_VERSION).tar.xz
+QT_VERSION := 5.11.0
+QT_URL := https://download.qt.io/official_releases/qt/5.11/$(QT_VERSION)/submodules/qtbase-everywhere-src-$(QT_VERSION).tar.xz
 
 ifdef HAVE_MACOSX
 #PKGS += qt
@@ -21,21 +21,9 @@ $(TARBALLS)/qt-$(QT_VERSION).tar.xz:
 
 qt: qt-$(QT_VERSION).tar.xz .sum-qt
 	$(UNPACK)
-	mv qtbase-opensource-src-$(QT_VERSION) qt-$(QT_VERSION)
-	$(APPLY) $(SRC)/qt/0001-Windows-QPA-Reimplement-calculation-of-window-frames_56.patch
-	$(APPLY) $(SRC)/qt/0002-Windows-QPA-Use-new-EnableNonClientDpiScaling-for-Wi_56.patch
-	$(APPLY) $(SRC)/qt/0003-QPA-prefer-lower-value-when-rounding-fractional-scaling.patch
-	$(APPLY) $(SRC)/qt/0004-qmake-don-t-limit-command-line-length-when-not-actua.patch
-	$(APPLY) $(SRC)/qt/0005-harfbuzz-Fix-building-for-win64-with-clang.patch
-	$(APPLY) $(SRC)/qt/0006-moc-Initialize-staticMetaObject-with-the-highest-use.patch
-	$(APPLY) $(SRC)/qt/0007-Only-define-QT_FASTCALL-on-x86_32.patch
-	$(APPLY) $(SRC)/qt/0008-Skip-arm-pixman-drawhelpers-on-windows-just-like-on-.patch
-	$(APPLY) $(SRC)/qt/0009-mkspecs-Add-a-win32-clang-g-mkspec-for-clang-targeti.patch
-	$(APPLY) $(SRC)/qt/0010-Add-the-QT_HAS_xxx-macros-for-post-C-11-feature-test.patch
-	$(APPLY) $(SRC)/qt/0011-qCount-Leading-Trailing-ZeroBits-Use-__builtin_clzs-.patch
-	$(APPLY) $(SRC)/qt/0012-Remove-_bit_scan_-forward-reverse.patch
-	$(APPLY) $(SRC)/qt/0013-qsimd-Fix-compilation-with-trunk-clang-for-mingw.patch
-	$(APPLY) $(SRC)/qt/systray-no-sound.patch
+	mv qtbase-everywhere-src-$(QT_VERSION) qt-$(QT_VERSION)
+	$(APPLY) $(SRC)/qt/0001-Windows-QPA-prefer-lower-value-when-rounding-fractio.patch
+	$(APPLY) $(SRC)/qt/0002-Windows-QPA-Disable-systray-notification-sounds.patch
 	$(MOVE)
 
 ifdef HAVE_MACOSX
@@ -56,7 +44,7 @@ endif
 
 QT_CONFIG := -static -opensource -confirm-license -no-pkg-config \
 	-no-sql-sqlite -no-gif -qt-libjpeg -no-openssl -no-opengl -no-dbus \
-	-no-qml-debug -no-audio-backend -no-sql-odbc -no-pch \
+	-no-sql-odbc -no-pch \
 	-no-compile-examples -nomake examples
 
 QT_CONFIG += -release
@@ -78,16 +66,16 @@ QT_CONFIG += -release
 	rm -rf $(PREFIX)/lib/libQt5Bootstrap* $</lib/libQt5Bootstrap*
 	# Fix .pc files to remove debug version (d)
 	cd $(PREFIX)/lib/pkgconfig; for i in Qt5Core.pc Qt5Gui.pc Qt5Widgets.pc; do sed -i.orig -e 's/d\.a/.a/g' -e 's/d $$/ /' $$i; done
-	# Fix Qt5Gui.pc file to include qwindows (QWindowsIntegrationPlugin) and Qt5Platform Support
-	cd $(PREFIX)/lib/pkgconfig; sed -i.orig -e 's/ -lQt5Gui/ -lqwindows -lQt5PlatformSupport -lQt5Gui/g' Qt5Gui.pc
+	# Fix Qt5Gui.pc file to include qwindows (QWindowsIntegrationPlugin) and platform support libraries
+	cd $(PREFIX)/lib/pkgconfig; sed -i.orig -e 's/ -lQt5Gui/ -lqwindows -lQt5ThemeSupport -lQt5FontDatabaseSupport -lQt5EventDispatcherSupport -lQt5WindowsUIAutomationSupport -lqtfreetype -lQt5Gui/g' Qt5Gui.pc
 ifdef HAVE_CROSS_COMPILE
 	# Building Qt build tools for Xcompilation
 	cd $</include/QtCore; $(LN_S)f $(QT_VERSION)/QtCore/private private
 	cd $<; $(MAKE) -C qmake
-	cd $<; $(MAKE) install_qmake install_mkspecs
+	cd $<; $(MAKE) sub-qmake-qmake-aux-pro-install_subtargets install_mkspecs
 	cd $</src/tools; \
 	for i in bootstrap uic rcc moc; \
-		do (cd $$i; echo $$i && ../../../bin/qmake -spec $(QT_SPEC) && $(MAKE) clean && $(MAKE) CC=$(HOST)-gcc CXX=$(HOST)-g++ LINKER=$(HOST)-g++ LIB="$(HOST)-ar -rc" && $(MAKE) install); \
+		do (cd $$i; echo $$i && ../../../bin/qmake -spec $(QT_SPEC) QMAKE_RC=$(HOST)-windres && $(MAKE) clean && $(MAKE) CC=$(HOST)-gcc CXX=$(HOST)-g++ LINKER=$(HOST)-g++ LIB="$(HOST)-ar -rc" && $(MAKE) install); \
 	done
 endif
 	touch $@
diff --git a/contrib/src/qt/systray-no-sound.patch b/contrib/src/qt/systray-no-sound.patch
deleted file mode 100644
index 0d80933161..0000000000
--- a/contrib/src/qt/systray-no-sound.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- qt/src/widgets/util/qsystemtrayicon_win.cpp.old
-+++ qt/src/widgets/util/qsystemtrayicon_win.cpp
-@@ -258,6 +258,10 @@ bool QSystemTrayIconSys::showMessage(con
-     }
-     if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA)
-         tnd.dwInfoFlags |= NIIF_LARGE_ICON;
-+
-+    // Never play audio on notifications.
-+    tnd.dwInfoFlags |= NIIF_NOSOUND;
-+
-     tnd.cbSize = notifyIconSize;
-     tnd.hWnd = m_hwnd;
-     tnd.uTimeout = uSecs;
-- 
2.26.2



More information about the vlc-devel mailing list