diff options
author | Liang Qi <liang.qi@qt.io> | 2017-02-16 21:46:20 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-02-16 21:51:11 +0100 |
commit | c577f6edafef7c40a5f78092ec4fcd78bb820b2c (patch) | |
tree | 9ca3819e5cca9b7e61f305a874b682e5a2085e83 /src/corelib/plugin | |
parent | 99ce1d3d97c0423c3ee63ccf58deed964db0770e (diff) | |
parent | de225ccdf95efb57866d62bc80872c1a2ab99703 (diff) |
Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
src/corelib/plugin/qlibrary_unix.cpp
src/plugins/platforms/xcb/qxcbconnection.cpp
tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp
Change-Id: I632c400d909f8c204f55743aadc7886af2f15dfb
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r-- | src/corelib/plugin/qlibrary_unix.cpp | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp index bb7874071e..3553763bcd 100644 --- a/src/corelib/plugin/qlibrary_unix.cpp +++ b/src/corelib/plugin/qlibrary_unix.cpp @@ -50,13 +50,9 @@ # include <private/qcore_mac_p.h> #endif -#if (defined(Q_OS_VXWORKS) && !defined(VXWORKS_RTP)) || defined (Q_OS_NACL) -#define QT_NO_DYNAMIC_LIBRARY -#endif - QT_BEGIN_NAMESPACE -#if !defined(QT_HPUX_LD) && !defined(QT_NO_DYNAMIC_LIBRARY) +#if !defined(QT_HPUX_LD) QT_BEGIN_INCLUDE_NAMESPACE #include <dlfcn.h> QT_END_INCLUDE_NAMESPACE @@ -64,9 +60,7 @@ QT_END_INCLUDE_NAMESPACE static QString qdlerror() { -#if defined(QT_NO_DYNAMIC_LIBRARY) - const char *err = "This platform does not support dynamic libraries."; -#elif !defined(QT_HPUX_LD) +#if !defined(QT_HPUX_LD) const char *err = dlerror(); #else const char *err = strerror(errno); @@ -131,7 +125,6 @@ QStringList QLibraryPrivate::prefixes_sys() bool QLibraryPrivate::load_sys() { QString attempt; -#if !defined(QT_NO_DYNAMIC_LIBRARY) QFileSystemEntry fsEntry(fileName); QString path = fsEntry.path(); @@ -250,7 +243,6 @@ bool QLibraryPrivate::load_sys() } } #endif -#endif // QT_NO_DYNAMIC_LIBRARY if (!pHnd) { errorString = QLibrary::tr("Cannot load library %1: %2").arg(fileName, qdlerror()); } @@ -263,29 +255,27 @@ bool QLibraryPrivate::load_sys() bool QLibraryPrivate::unload_sys() { -#if !defined(QT_NO_DYNAMIC_LIBRARY) -# if defined(QT_HPUX_LD) +#if defined(QT_HPUX_LD) if (shl_unload((shl_t)pHnd)) { -# else +#else if (dlclose(pHnd)) { -# endif -# if defined (Q_OS_QNX) // Workaround until fixed in QNX; fixes crash in +#endif +#if defined (Q_OS_QNX) // Workaround until fixed in QNX; fixes crash in char *error = dlerror(); // QtDeclarative auto test "qqmlenginecleanup" for instance if (!qstrcmp(error, "Shared objects still referenced")) // On QNX that's only "informative" return true; errorString = QLibrary::tr("Cannot unload library %1: %2").arg(fileName, QLatin1String(error)); -# else +#else errorString = QLibrary::tr("Cannot unload library %1: %2").arg(fileName, qdlerror()); -# endif +#endif return false; } -#endif errorString.clear(); return true; } -#if defined(Q_OS_LINUX) && !defined(QT_NO_DYNAMIC_LIBRARY) +#if defined(Q_OS_LINUX) Q_CORE_EXPORT QFunctionPointer qt_linux_find_symbol_sys(const char *symbol) { return QFunctionPointer(dlsym(RTLD_DEFAULT, symbol)); @@ -305,8 +295,6 @@ QFunctionPointer QLibraryPrivate::resolve_sys(const char* symbol) QFunctionPointer address = 0; if (shl_findsym((shl_t*)&pHnd, symbol, TYPE_UNDEFINED, &address) < 0) address = 0; -#elif defined (QT_NO_DYNAMIC_LIBRARY) - QFunctionPointer address = 0; #else QFunctionPointer address = QFunctionPointer(dlsym(pHnd, symbol)); #endif |