From a6266810ae5b285d9ff3fce856e543c7075816e7 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Mon, 5 Sep 2022 16:51:15 +0200 Subject: [PATCH] Fix compilation with clang Amends 711105058afe68407a0ed613335a83b6181112ed and fixes the following errors: .../qeglfsx11integration.cpp:28:36: note: non-constexpr constructor 'QBasicAtomicInteger' cannot be used in a constant expression Q_CONSTINIT static QBasicAtomicInt running; ^ .../qbasicatomic.h:171:5: note: declared here QBasicAtomicInteger() = default; And: .../qoffscreenwindow.cpp:171:50: error: 'constinit' specifier missing on initializing declaration of 'm_windowForWinIdHash' [-Werror,-Wmissing-constinit] QHash QOffscreenWindow::m_windowForWinIdHash; ^ Q_CONSTINIT .../qoffscreenwindow.h:44:5: note: variable declared constinit here Q_CONSTINIT static QHash m_windowForWinIdHash; Change-Id: I991674826737db897e087e9e06b56b338ca61a4f Reviewed-by: Ievgenii Meshcheriakov --- .../eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp | 2 +- src/plugins/platforms/offscreen/qoffscreenwindow.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp index 8dd468bff38..cfe735352d7 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp @@ -25,7 +25,7 @@ private: QEglFSX11Integration *m_integration; }; -Q_CONSTINIT static QBasicAtomicInt running; +Q_CONSTINIT static QBasicAtomicInt running = Q_BASIC_ATOMIC_INITIALIZER(0); void EventReader::run() { diff --git a/src/plugins/platforms/offscreen/qoffscreenwindow.cpp b/src/plugins/platforms/offscreen/qoffscreenwindow.cpp index b009722e562..6f61d72ed31 100644 --- a/src/plugins/platforms/offscreen/qoffscreenwindow.cpp +++ b/src/plugins/platforms/offscreen/qoffscreenwindow.cpp @@ -168,6 +168,6 @@ QOffscreenWindow *QOffscreenWindow::windowForWinId(WId id) return m_windowForWinIdHash.value(id, 0); } -QHash QOffscreenWindow::m_windowForWinIdHash; +Q_CONSTINIT QHash QOffscreenWindow::m_windowForWinIdHash; QT_END_NAMESPACE