summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-12-19 10:34:32 +0100
committerUlf Hermann <ulf.hermann@qt.io>2017-03-06 11:27:20 +0000
commitd6330a19b29ebff359a6746250c78437dbcaf77d (patch)
tree3ab0e390f0bfd30bb235ed5a0128bfd33e9cd4b7 /src/network
parentf31dbeb4c7cd0d7559a8d7f523a3feea7d376186 (diff)
Use QT_CONFIG(library) instead of QT_NO_LIBRARY
For the windows file system engine, we add an extra macro to use library loading if configured to do so, but avoid it on WinRT, as none of the symbols would be found. We also QT_REQUIRE_CONFIG(library) in the library headers and exclude the sources from the build if library loading is disabled. This, in turn, makes it necessary to clean up some header inclusions. Change-Id: I2b152cb5b47a2658996b6f4702b038536a5704ec Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/kernel/qdnslookup_unix.cpp6
-rw-r--r--src/network/kernel/qhostinfo_unix.cpp4
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp5
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp13
4 files changed, 15 insertions, 13 deletions
diff --git a/src/network/kernel/qdnslookup_unix.cpp b/src/network/kernel/qdnslookup_unix.cpp
index 41038dc8da..1da00813ce 100644
--- a/src/network/kernel/qdnslookup_unix.cpp
+++ b/src/network/kernel/qdnslookup_unix.cpp
@@ -39,7 +39,9 @@
#include "qdnslookup_p.h"
+#if QT_CONFIG(library)
#include <qlibrary.h>
+#endif
#include <qscopedpointer.h>
#include <qurl.h>
#include <private/qnativesocketengine_p.h>
@@ -58,7 +60,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
#if defined(Q_OS_OPENBSD)
typedef struct __res_state* res_state;
@@ -382,6 +384,6 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
return;
}
-#endif /* ifndef QT_NO_LIBRARY */
+#endif /* QT_CONFIG(library) */
QT_END_NAMESPACE
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index 7af8db73e0..cf08a15f96 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -45,7 +45,9 @@
#include "private/qnativesocketengine_p.h"
#include "qiodevice.h"
#include <qbytearray.h>
+#if QT_CONFIG(library)
#include <qlibrary.h>
+#endif
#include <qbasicatomic.h>
#include <qurl.h>
#include <qfile.h>
@@ -93,7 +95,7 @@ static res_state_ptr local_res = 0;
static bool resolveLibraryInternal()
{
-#if !defined(QT_NO_LIBRARY) && !defined(Q_OS_QNX)
+#if QT_CONFIG(library) && !defined(Q_OS_QNX)
QLibrary lib;
#ifdef LIBRESOLV_SO
lib.setFileName(QStringLiteral(LIBRESOLV_SO));
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index aca7507d13..644dfdb6a8 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -78,7 +78,6 @@
#include <QtCore/qthread.h>
#include <QtCore/qurl.h>
#include <QtCore/qvarlengtharray.h>
-#include <QLibrary> // for loading the security lib for the CA store
#include <string.h>
@@ -530,7 +529,7 @@ void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
resetDefaultCiphers();
resetDefaultEllipticCurves();
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
//load symbols needed to receive certificates from system store
#if defined(Q_OS_WIN)
HINSTANCE hLib = LoadLibraryW(L"Crypt32");
@@ -558,7 +557,7 @@ void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
}
}
#endif
-#endif //QT_NO_LIBRARY
+#endif // QT_CONFIG(library)
// if on-demand loading was not enabled, load the certs now
if (!s_loadRootCertsOnDemand)
setDefaultCaCertificates(systemCaCertificates());
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index 2a0d746fde..1b2419ef07 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -58,7 +58,7 @@
#ifdef Q_OS_WIN
# include <private/qsystemlibrary_p.h>
-#else
+#elif QT_CONFIG(library)
# include <QtCore/qlibrary.h>
#endif
#include <QtCore/qmutex.h>
@@ -125,7 +125,7 @@ void qsslSocketUnresolvedSymbolWarning(const char *functionName)
qCWarning(lcSsl, "QSslSocket: cannot call unresolved function %s", functionName);
}
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
void qsslSocketCannotResolveSymbolWarning(const char *functionName)
{
qCWarning(lcSsl, "QSslSocket: cannot resolve %s", functionName);
@@ -468,12 +468,11 @@ DEFINEFUNC(void, PKCS12_free, PKCS12 *pkcs12, pkcs12, return, DUMMYARG)
#if !defined QT_LINKED_OPENSSL
-#ifdef QT_NO_LIBRARY
+#if !QT_CONFIG(library)
bool q_resolveOpenSslSymbols()
{
- qCWarning(lcSsl, "QSslSocket: unable to resolve symbols. "
- "QT_NO_LIBRARY is defined which means runtime resolving of "
- "libraries won't work.");
+ qCWarning(lcSsl, "QSslSocket: unable to resolve symbols. Qt is configured without the "
+ "'library' feature, which means runtime resolving of libraries won't work.");
qCWarning(lcSsl, "Either compile Qt statically or with support for runtime resolving "
"of libraries.");
return false;
@@ -1034,7 +1033,7 @@ bool q_resolveOpenSslSymbols()
delete libs.second;
return true;
}
-#endif // QT_NO_LIBRARY
+#endif // QT_CONFIG(library)
#else // !defined QT_LINKED_OPENSSL