summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin/qlibrary_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/plugin/qlibrary_unix.cpp')
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp35
1 files changed, 2 insertions, 33 deletions
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index 3c4fbaf348..23b9ad6434 100644
--- a/src/corelib/plugin/qlibrary_unix.cpp
+++ b/src/corelib/plugin/qlibrary_unix.cpp
@@ -44,25 +44,17 @@
#include <qcoreapplication.h>
#include <private/qfilesystementry_p.h>
+#include <dlfcn.h>
+
#ifdef Q_OS_MAC
# include <private/qcore_mac_p.h>
#endif
QT_BEGIN_NAMESPACE
-#if !defined(QT_HPUX_LD)
-QT_BEGIN_INCLUDE_NAMESPACE
-#include <dlfcn.h>
-QT_END_INCLUDE_NAMESPACE
-#endif
-
static QString qdlerror()
{
-#if !defined(QT_HPUX_LD)
const char *err = dlerror();
-#else
- const char *err = strerror(errno);
-#endif
return err ? QLatin1Char('(') + QString::fromLocal8Bit(err) + QLatin1Char(')'): QString();
}
@@ -139,14 +131,6 @@ bool QLibraryPrivate::load_sys()
suffixes = suffixes_sys(fullVersion);
}
int dlFlags = 0;
-#if defined(QT_HPUX_LD)
- dlFlags = DYNAMIC_PATH | BIND_NONFATAL;
- if (loadHints & QLibrary::ResolveAllSymbolsHint) {
- dlFlags |= BIND_IMMEDIATE;
- } else {
- dlFlags |= BIND_DEFERRED;
- }
-#else
int loadHints = this->loadHints();
if (loadHints & QLibrary::ResolveAllSymbolsHint) {
dlFlags |= RTLD_NOW;
@@ -182,7 +166,6 @@ bool QLibraryPrivate::load_sys()
dlFlags |= RTLD_MEMBER;
}
#endif
-#endif // QT_HPUX_LD
// If the filename is an absolute path then we want to try that first as it is most likely
// what the callee wants. If we have been given a non-absolute path then lets try the
@@ -211,11 +194,7 @@ bool QLibraryPrivate::load_sys()
} else {
attempt = path + prefixes.at(prefix) + name + suffixes.at(suffix);
}
-#if defined(QT_HPUX_LD)
- pHnd = (void*)shl_load(QFile::encodeName(attempt), dlFlags, 0);
-#else
pHnd = dlopen(QFile::encodeName(attempt), dlFlags);
-#endif
if (!pHnd && fileName.startsWith(QLatin1Char('/')) && QFile::exists(attempt)) {
// We only want to continue if dlopen failed due to that the shared library did not exist.
@@ -253,11 +232,7 @@ bool QLibraryPrivate::load_sys()
bool QLibraryPrivate::unload_sys()
{
-#if defined(QT_HPUX_LD)
- if (shl_unload((shl_t)pHnd)) {
-#else
if (dlclose(pHnd)) {
-#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"
@@ -289,13 +264,7 @@ Q_CORE_EXPORT QFunctionPointer qt_mac_resolve_sys(void *handle, const char *symb
QFunctionPointer QLibraryPrivate::resolve_sys(const char* symbol)
{
-#if defined(QT_HPUX_LD)
- QFunctionPointer address = 0;
- if (shl_findsym((shl_t*)&pHnd, symbol, TYPE_UNDEFINED, &address) < 0)
- address = 0;
-#else
QFunctionPointer address = QFunctionPointer(dlsym(pHnd, symbol));
-#endif
if (!address) {
errorString = QLibrary::tr("Cannot resolve symbol \"%1\" in %2: %3").arg(
QString::fromLatin1(symbol), fileName, qdlerror());