summaryrefslogtreecommitdiffstats
path: root/src/network/kernel
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-04-01 09:39:11 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-04-05 16:27:16 +0200
commitd2d202c64870e56f6ac3f802abe6c9c978136f53 (patch)
treeb23a2a33957250dbbacaae08519efab23425a5ce /src/network/kernel
parentbfd2d301693bbf278157db23dd322d30d66edd3b (diff)
QtNetwork: sweep Q_DECLARE_METATYPE → QT_DECL_METATYPE_EXTERN [1/2]: public API
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 <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/network/kernel')
-rw-r--r--src/network/kernel/qhostinfo.cpp2
-rw-r--r--src/network/kernel/qhostinfo.h2
-rw-r--r--src/network/kernel/qnetworkdatagram.cpp2
-rw-r--r--src/network/kernel/qnetworkdatagram.h2
-rw-r--r--src/network/kernel/qnetworkinterface.cpp3
-rw-r--r--src/network/kernel/qnetworkinterface.h4
-rw-r--r--src/network/kernel/qnetworkproxy.cpp2
-rw-r--r--src/network/kernel/qnetworkproxy.h2
8 files changed, 14 insertions, 5 deletions
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<QNetworkAddressEntryPrivate>) == sizeof(std::unique_ptr<QNetworkAddressEntryPrivate>));
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