Fix compilation with clang

Amends 711105058a 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<WId, QOffscreenWindow *> QOffscreenWindow::m_windowForWinIdHash;
                                                 ^
Q_CONSTINIT
.../qoffscreenwindow.h:44:5: note: variable declared constinit here
Q_CONSTINIT static QHash<WId, QOffscreenWindow *> m_windowForWinIdHash;

Change-Id: I991674826737db897e087e9e06b56b338ca61a4f
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
This commit is contained in:
Sona Kurazyan 2022-09-05 16:51:15 +02:00
parent da84941375
commit a6266810ae
2 changed files with 2 additions and 2 deletions

View File

@ -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()
{

View File

@ -168,6 +168,6 @@ QOffscreenWindow *QOffscreenWindow::windowForWinId(WId id)
return m_windowForWinIdHash.value(id, 0);
}
QHash<WId, QOffscreenWindow *> QOffscreenWindow::m_windowForWinIdHash;
Q_CONSTINIT QHash<WId, QOffscreenWindow *> QOffscreenWindow::m_windowForWinIdHash;
QT_END_NAMESPACE