From b53c229a4b394e6b83268151845e1fee734f633d Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Sat, 14 Jan 2017 12:22:53 +0900 Subject: Fix build without features.networkinterface Change-Id: I9fd2a7ec402a1d2d99e30f08554d86f18c6424ff Reviewed-by: Paul Olav Tvete --- src/network/socket/qnativesocketengine_p.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/network/socket/qnativesocketengine_p.h') diff --git a/src/network/socket/qnativesocketengine_p.h b/src/network/socket/qnativesocketengine_p.h index 4d1d8e1eb1..08e72072ef 100644 --- a/src/network/socket/qnativesocketengine_p.h +++ b/src/network/socket/qnativesocketengine_p.h @@ -286,8 +286,10 @@ public: bool checkProxy(const QHostAddress &address); bool fetchConnectionParameters(); +#if QT_CONFIG(networkinterface) static uint scopeIdFromString(const QString &scopeid) { return QNetworkInterface::interfaceIndexFromName(scopeid); } +#endif /*! \internal Sets \a address and \a port in the \a aa sockaddr structure and the size in \a sockAddrSize. @@ -301,7 +303,9 @@ public: || socketProtocol == QAbstractSocket::AnyIPProtocol) { memset(&aa->a6, 0, sizeof(sockaddr_in6)); aa->a6.sin6_family = AF_INET6; +#if QT_CONFIG(networkinterface) aa->a6.sin6_scope_id = scopeIdFromString(address.scopeId()); +#endif aa->a6.sin6_port = htons(port); Q_IPV6ADDR tmp = address.toIPv6Address(); memcpy(&aa->a6.sin6_addr, &tmp, sizeof(tmp)); -- cgit v1.2.3