diff options
author | Liang Qi <liang.qi@qt.io> | 2017-02-17 09:06:15 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2017-02-17 10:36:32 +0000 |
commit | e5c3700a61c03e674544e51a063de80338f8a7b0 (patch) | |
tree | b7c0860f3c83358b2bea03e7915fd98d09db7c02 /src/corelib/plugin | |
parent | a81dfb32d6f9e7a407567511c20b59e537f6a063 (diff) | |
parent | c577f6edafef7c40a5f78092ec4fcd78bb820b2c (diff) |
Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9
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 |