From d2d202c64870e56f6ac3f802abe6c9c978136f53 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 1 Apr 2022 09:39:11 +0200 Subject: [PATCH] =?UTF-8?q?QtNetwork:=20sweep=20Q=5FDECLARE=5FMETATYPE=20?= =?UTF-8?q?=E2=86=92=20QT=5FDECL=5FMETATYPE=5FEXTERN=20[1/2]:=20public=20A?= =?UTF-8?q?PI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's one of our best tools to improve compile times. Can't backport to Qt 6.3 or 6.2 because this change introduces new exported symbols. Task-number: QTBUG-102206 Change-Id: I6bfa532be34ca847d3b9034d16c94efed3d602c3 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Qt CI Bot --- src/network/access/qnetworkcookie.cpp | 2 ++ src/network/access/qnetworkcookie.h | 2 +- src/network/access/qnetworkreply.cpp | 2 ++ src/network/access/qnetworkreply.h | 3 ++- src/network/access/qnetworkrequest.cpp | 3 +++ src/network/access/qnetworkrequest.h | 5 +++-- src/network/kernel/qhostinfo.cpp | 2 ++ src/network/kernel/qhostinfo.h | 2 +- src/network/kernel/qnetworkdatagram.cpp | 2 ++ src/network/kernel/qnetworkdatagram.h | 2 +- src/network/kernel/qnetworkinterface.cpp | 3 +++ src/network/kernel/qnetworkinterface.h | 4 ++-- src/network/kernel/qnetworkproxy.cpp | 2 ++ src/network/kernel/qnetworkproxy.h | 2 +- src/network/socket/qabstractsocket.cpp | 3 +++ src/network/socket/qabstractsocket.h | 6 ++++-- src/network/ssl/qocspresponse.cpp | 2 ++ src/network/ssl/qocspresponse.h | 2 +- src/network/ssl/qsslcertificate.cpp | 2 ++ src/network/ssl/qsslcertificate.h | 2 +- src/network/ssl/qsslconfiguration.cpp | 2 ++ src/network/ssl/qsslconfiguration.h | 2 +- src/network/ssl/qsslellipticcurve.cpp | 2 ++ src/network/ssl/qsslellipticcurve.h | 2 +- src/network/ssl/qsslerror.cpp | 5 +++++ src/network/ssl/qsslerror.h | 2 +- src/network/ssl/qsslpresharedkeyauthenticator.cpp | 3 +++ src/network/ssl/qsslpresharedkeyauthenticator.h | 4 ++-- 28 files changed, 57 insertions(+), 18 deletions(-) diff --git a/src/network/access/qnetworkcookie.cpp b/src/network/access/qnetworkcookie.cpp index 81e321d86a..3e8ceb08e3 100644 --- a/src/network/access/qnetworkcookie.cpp +++ b/src/network/access/qnetworkcookie.cpp @@ -55,6 +55,8 @@ QT_BEGIN_NAMESPACE +QT_IMPL_METATYPE_EXTERN(QNetworkCookie) + /*! \class QNetworkCookie \since 4.4 diff --git a/src/network/access/qnetworkcookie.h b/src/network/access/qnetworkcookie.h index dfb5f7c14d..39a7265058 100644 --- a/src/network/access/qnetworkcookie.h +++ b/src/network/access/qnetworkcookie.h @@ -127,6 +127,6 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug, const QNetworkCookie &); QT_END_NAMESPACE -Q_DECLARE_METATYPE(QNetworkCookie) +QT_DECL_METATYPE_EXTERN(QNetworkCookie, Q_NETWORK_EXPORT) #endif diff --git a/src/network/access/qnetworkreply.cpp b/src/network/access/qnetworkreply.cpp index 05230b1e26..7e60374dd7 100644 --- a/src/network/access/qnetworkreply.cpp +++ b/src/network/access/qnetworkreply.cpp @@ -45,6 +45,8 @@ QT_BEGIN_NAMESPACE +QT_IMPL_METATYPE_EXTERN_TAGGED(QNetworkReply::NetworkError, QNetworkReply__NetworkError) + const int QNetworkReplyPrivate::progressSignalInterval = 100; QNetworkReplyPrivate::QNetworkReplyPrivate() diff --git a/src/network/access/qnetworkreply.h b/src/network/access/qnetworkreply.h index 3bd034dd8d..6ce188c037 100644 --- a/src/network/access/qnetworkreply.h +++ b/src/network/access/qnetworkreply.h @@ -196,6 +196,7 @@ private: QT_END_NAMESPACE -Q_DECLARE_METATYPE(QNetworkReply::NetworkError) +QT_DECL_METATYPE_EXTERN_TAGGED(QNetworkReply::NetworkError, + QNetworkReply__NetworkError, Q_NETWORK_EXPORT) #endif diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index 8cc916b153..5734ac0dc5 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -59,6 +59,9 @@ QT_BEGIN_NAMESPACE +QT_IMPL_METATYPE_EXTERN(QNetworkRequest) +QT_IMPL_METATYPE_EXTERN_TAGGED(QNetworkRequest::RedirectPolicy, QNetworkRequest__RedirectPolicy) + /*! \class QNetworkRequest \since 4.4 diff --git a/src/network/access/qnetworkrequest.h b/src/network/access/qnetworkrequest.h index c797b853c4..b4f7e778a0 100644 --- a/src/network/access/qnetworkrequest.h +++ b/src/network/access/qnetworkrequest.h @@ -199,7 +199,8 @@ Q_DECLARE_SHARED(QNetworkRequest) QT_END_NAMESPACE -Q_DECLARE_METATYPE(QNetworkRequest) -Q_DECLARE_METATYPE(QNetworkRequest::RedirectPolicy) +QT_DECL_METATYPE_EXTERN(QNetworkRequest, Q_NETWORK_EXPORT) +QT_DECL_METATYPE_EXTERN_TAGGED(QNetworkRequest::RedirectPolicy, + QNetworkRequest__RedirectPolicy, Q_NETWORK_EXPORT) #endif diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index aade547125..4ec1a06f59 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -72,6 +72,8 @@ QT_BEGIN_NAMESPACE //#define QHOSTINFO_DEBUG +QT_IMPL_METATYPE_EXTERN(QHostInfo) + namespace { struct ToBeLookedUpEquals { typedef bool result_type; diff --git a/src/network/kernel/qhostinfo.h b/src/network/kernel/qhostinfo.h index ecab6360e8..5b32bc44f4 100644 --- a/src/network/kernel/qhostinfo.h +++ b/src/network/kernel/qhostinfo.h @@ -164,6 +164,6 @@ Q_DECLARE_SHARED(QHostInfo) QT_END_NAMESPACE -Q_DECLARE_METATYPE(QHostInfo) +QT_DECL_METATYPE_EXTERN(QHostInfo, Q_NETWORK_EXPORT) #endif // QHOSTINFO_H diff --git a/src/network/kernel/qnetworkdatagram.cpp b/src/network/kernel/qnetworkdatagram.cpp index c8c87d4549..dbbbd6d570 100644 --- a/src/network/kernel/qnetworkdatagram.cpp +++ b/src/network/kernel/qnetworkdatagram.cpp @@ -44,6 +44,8 @@ QT_BEGIN_NAMESPACE +QT_IMPL_METATYPE_EXTERN(QNetworkDatagram) + /*! \class QNetworkDatagram \brief The QNetworkDatagram class provides the data and metadata of a UDP datagram. diff --git a/src/network/kernel/qnetworkdatagram.h b/src/network/kernel/qnetworkdatagram.h index 2b4facecff..f7fc6293d0 100644 --- a/src/network/kernel/qnetworkdatagram.h +++ b/src/network/kernel/qnetworkdatagram.h @@ -116,7 +116,7 @@ Q_DECLARE_SHARED(QNetworkDatagram) QT_END_NAMESPACE -Q_DECLARE_METATYPE(QNetworkDatagram) +QT_DECL_METATYPE_EXTERN(QNetworkDatagram, Q_NETWORK_EXPORT) #endif // QT_NO_UDPSOCKET diff --git a/src/network/kernel/qnetworkinterface.cpp b/src/network/kernel/qnetworkinterface.cpp index 250d315aba..6fe56443bc 100644 --- a/src/network/kernel/qnetworkinterface.cpp +++ b/src/network/kernel/qnetworkinterface.cpp @@ -49,6 +49,9 @@ QT_BEGIN_NAMESPACE +QT_IMPL_METATYPE_EXTERN(QNetworkAddressEntry) +QT_IMPL_METATYPE_EXTERN(QNetworkInterface) + static_assert(QT_VERSION < QT_VERSION_CHECK(7, 0, 0) && sizeof(QScopedPointer) == sizeof(std::unique_ptr)); diff --git a/src/network/kernel/qnetworkinterface.h b/src/network/kernel/qnetworkinterface.h index 34e2929092..295af5b799 100644 --- a/src/network/kernel/qnetworkinterface.h +++ b/src/network/kernel/qnetworkinterface.h @@ -182,8 +182,8 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QNetworkInterface &networ QT_END_NAMESPACE -Q_DECLARE_METATYPE(QNetworkAddressEntry) -Q_DECLARE_METATYPE(QNetworkInterface) +QT_DECL_METATYPE_EXTERN(QNetworkAddressEntry, Q_NETWORK_EXPORT) +QT_DECL_METATYPE_EXTERN(QNetworkInterface, Q_NETWORK_EXPORT) #endif // QT_NO_NETWORKINTERFACE diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp index 8cecbc2582..906a518a89 100644 --- a/src/network/kernel/qnetworkproxy.cpp +++ b/src/network/kernel/qnetworkproxy.cpp @@ -243,6 +243,8 @@ QT_BEGIN_NAMESPACE +QT_IMPL_METATYPE_EXTERN(QNetworkProxy) + class QSocks5SocketEngineHandler; class QHttpSocketEngineHandler; diff --git a/src/network/kernel/qnetworkproxy.h b/src/network/kernel/qnetworkproxy.h index bf5af82064..83abffd832 100644 --- a/src/network/kernel/qnetworkproxy.h +++ b/src/network/kernel/qnetworkproxy.h @@ -210,7 +210,7 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QNetworkProxyQuery &proxy QT_END_NAMESPACE -Q_DECLARE_METATYPE(QNetworkProxy) +QT_DECL_METATYPE_EXTERN(QNetworkProxy, Q_NETWORK_EXPORT) #endif // QT_NO_NETWORKPROXY diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 53ef298d76..befe136b13 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -500,6 +500,9 @@ QT_BEGIN_NAMESPACE +QT_IMPL_METATYPE_EXTERN_TAGGED(QAbstractSocket::SocketState, QAbstractSocket__SocketState) +QT_IMPL_METATYPE_EXTERN_TAGGED(QAbstractSocket::SocketError, QAbstractSocket__SocketError) + static const int DefaultConnectTimeout = 30000; static bool isProxyError(QAbstractSocket::SocketError error) diff --git a/src/network/socket/qabstractsocket.h b/src/network/socket/qabstractsocket.h index 03baa879aa..8f6d248355 100644 --- a/src/network/socket/qabstractsocket.h +++ b/src/network/socket/qabstractsocket.h @@ -270,7 +270,9 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug, QAbstractSocket::SocketState); QT_END_NAMESPACE -Q_DECLARE_METATYPE(QAbstractSocket::SocketState) -Q_DECLARE_METATYPE(QAbstractSocket::SocketError) +QT_DECL_METATYPE_EXTERN_TAGGED(QAbstractSocket::SocketState, + QAbstractSocket__SocketState, Q_NETWORK_EXPORT) +QT_DECL_METATYPE_EXTERN_TAGGED(QAbstractSocket::SocketError, + QAbstractSocket__SocketError, Q_NETWORK_EXPORT) #endif // QABSTRACTSOCKET_H diff --git a/src/network/ssl/qocspresponse.cpp b/src/network/ssl/qocspresponse.cpp index 75d7e1600d..3c63f23bbc 100644 --- a/src/network/ssl/qocspresponse.cpp +++ b/src/network/ssl/qocspresponse.cpp @@ -44,6 +44,8 @@ QT_BEGIN_NAMESPACE +QT_IMPL_METATYPE_EXTERN(QOcspResponse) + /*! \class QOcspResponse \brief This class represents Online Certificate Status Protocol response. diff --git a/src/network/ssl/qocspresponse.h b/src/network/ssl/qocspresponse.h index 2bceadf86e..e79fb0443c 100644 --- a/src/network/ssl/qocspresponse.h +++ b/src/network/ssl/qocspresponse.h @@ -118,6 +118,6 @@ Q_DECLARE_SHARED(QOcspResponse) QT_END_NAMESPACE -Q_DECLARE_METATYPE(QOcspResponse) +QT_DECL_METATYPE_EXTERN(QOcspResponse, Q_NETWORK_EXPORT) #endif // QOCSPRESPONSE_H diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index 41b4beb418..80b6088dbc 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -151,6 +151,8 @@ QT_BEGIN_NAMESPACE +QT_IMPL_METATYPE_EXTERN(QSslCertificate) + QSslCertificatePrivate::QSslCertificatePrivate() { #ifndef QT_NO_SSL diff --git a/src/network/ssl/qsslcertificate.h b/src/network/ssl/qsslcertificate.h index 94e784745b..ec4c4c1881 100644 --- a/src/network/ssl/qsslcertificate.h +++ b/src/network/ssl/qsslcertificate.h @@ -167,6 +167,6 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, QSslCertificate::SubjectInfo in QT_END_NAMESPACE -Q_DECLARE_METATYPE(QSslCertificate) +QT_DECL_METATYPE_EXTERN(QSslCertificate, Q_NETWORK_EXPORT) #endif diff --git a/src/network/ssl/qsslconfiguration.cpp b/src/network/ssl/qsslconfiguration.cpp index 9684e3477e..bbd9c02d34 100644 --- a/src/network/ssl/qsslconfiguration.cpp +++ b/src/network/ssl/qsslconfiguration.cpp @@ -48,6 +48,8 @@ QT_BEGIN_NAMESPACE +QT_IMPL_METATYPE_EXTERN(QSslConfiguration) + const QSsl::SslOptions QSslConfigurationPrivate::defaultSslOptions = QSsl::SslOptionDisableEmptyFragments |QSsl::SslOptionDisableLegacyRenegotiation |QSsl::SslOptionDisableCompression diff --git a/src/network/ssl/qsslconfiguration.h b/src/network/ssl/qsslconfiguration.h index f88110f5a9..75e3dda256 100644 --- a/src/network/ssl/qsslconfiguration.h +++ b/src/network/ssl/qsslconfiguration.h @@ -206,7 +206,7 @@ Q_DECLARE_SHARED(QSslConfiguration) QT_END_NAMESPACE -Q_DECLARE_METATYPE(QSslConfiguration) +QT_DECL_METATYPE_EXTERN(QSslConfiguration, Q_NETWORK_EXPORT) #endif // QT_NO_SSL diff --git a/src/network/ssl/qsslellipticcurve.cpp b/src/network/ssl/qsslellipticcurve.cpp index 7d1a911e67..926181d899 100644 --- a/src/network/ssl/qsslellipticcurve.cpp +++ b/src/network/ssl/qsslellipticcurve.cpp @@ -47,6 +47,8 @@ QT_BEGIN_NAMESPACE +QT_IMPL_METATYPE_EXTERN(QSslEllipticCurve) + /*! \class QSslEllipticCurve \since 5.5 diff --git a/src/network/ssl/qsslellipticcurve.h b/src/network/ssl/qsslellipticcurve.h index c8ead24433..457b6bd49e 100644 --- a/src/network/ssl/qsslellipticcurve.h +++ b/src/network/ssl/qsslellipticcurve.h @@ -96,6 +96,6 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, QSslEllipticCurve curve); QT_END_NAMESPACE -Q_DECLARE_METATYPE(QSslEllipticCurve) +QT_DECL_METATYPE_EXTERN(QSslEllipticCurve, Q_NETWORK_EXPORT) #endif // QSSLELLIPTICCURVE_H diff --git a/src/network/ssl/qsslerror.cpp b/src/network/ssl/qsslerror.cpp index 6a4cef22ed..6c0c0fbc4b 100644 --- a/src/network/ssl/qsslerror.cpp +++ b/src/network/ssl/qsslerror.cpp @@ -111,6 +111,11 @@ QT_BEGIN_NAMESPACE +#ifndef QT_NO_SSL +QT_IMPL_METATYPE_EXTERN_TAGGED(QList, QList_QSslError) +#endif + + #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) // Avoid an ABI break due to the QScopedPointer->std::unique_ptr change static_assert(sizeof(QScopedPointer) == sizeof(std::unique_ptr)); diff --git a/src/network/ssl/qsslerror.h b/src/network/ssl/qsslerror.h index 326e35301c..f210605d19 100644 --- a/src/network/ssl/qsslerror.h +++ b/src/network/ssl/qsslerror.h @@ -141,7 +141,7 @@ class Q_NETWORK_EXPORT QSslError {}; // dummy class so that moc has a complete t QT_END_NAMESPACE #ifndef QT_NO_SSL -Q_DECLARE_METATYPE(QList) +QT_DECL_METATYPE_EXTERN_TAGGED(QList, QList_QSslError, Q_NETWORK_EXPORT) #endif #endif diff --git a/src/network/ssl/qsslpresharedkeyauthenticator.cpp b/src/network/ssl/qsslpresharedkeyauthenticator.cpp index fe797ef883..3628662e7a 100644 --- a/src/network/ssl/qsslpresharedkeyauthenticator.cpp +++ b/src/network/ssl/qsslpresharedkeyauthenticator.cpp @@ -44,6 +44,9 @@ QT_BEGIN_NAMESPACE +QT_IMPL_METATYPE_EXTERN(QSslPreSharedKeyAuthenticator) +QT_IMPL_METATYPE_EXTERN_TAGGED(QSslPreSharedKeyAuthenticator*, QSslPreSharedKeyAuthenticator_ptr) + /*! \internal */ diff --git a/src/network/ssl/qsslpresharedkeyauthenticator.h b/src/network/ssl/qsslpresharedkeyauthenticator.h index 56c0e25900..3329507f83 100644 --- a/src/network/ssl/qsslpresharedkeyauthenticator.h +++ b/src/network/ssl/qsslpresharedkeyauthenticator.h @@ -90,7 +90,7 @@ Q_DECLARE_SHARED(QSslPreSharedKeyAuthenticator) QT_END_NAMESPACE -Q_DECLARE_METATYPE(QSslPreSharedKeyAuthenticator) -Q_DECLARE_METATYPE(QSslPreSharedKeyAuthenticator*) +QT_DECL_METATYPE_EXTERN(QSslPreSharedKeyAuthenticator, Q_NETWORK_EXPORT) +QT_DECL_METATYPE_EXTERN_TAGGED(QSslPreSharedKeyAuthenticator*, QSslPreSharedKeyAuthenticator_ptr, Q_NETWORK_EXPORT) #endif // QSSLPRESHAREDKEYAUTHENTICATOR_H