5#include "qplatformdefs.h"
10#include <private/qfilesystementry_p.h>
11#include <private/qsimd_p.h>
16# include <private/qcore_mac_p.h>
20#include <private/qjnihelpers_p.h>
21#include <QtCore/qjnienvironment.h>
56#elif defined(Q_OS_AIX)
74 suffixes <<
".bundle"_L1 <<
".dylib"_L1;
85bool QLibraryPrivate::load_sys()
87#if defined(Q_OS_WASM) && defined(QT_STATIC)
105 if (pluginState != IsAPlugin) {
114 dlFlags |= RTLD_LAZY;
117 dlFlags |= RTLD_GLOBAL;
119#if !defined(Q_OS_CYGWIN)
121 dlFlags |= RTLD_LOCAL;
124#if defined(RTLD_DEEPBIND)
126 dlFlags |= RTLD_DEEPBIND;
134#if defined(RTLD_NODELETE)
139 dlFlags |= RTLD_NODELETE;
145 dlFlags |= RTLD_MEMBER;
152 if (fsEntry.isAbsolute()) {
160#if defined(Q_PROCESSOR_X86) && !defined(Q_OS_DARWIN)
173 if (pluginState == IsAPlugin) {
186 for (
int prefix = 0; retry && !hnd && prefix < prefixes.size(); prefix++) {
187 for (
int suffix = 0; retry && !hnd && suffix < suffixes.size(); suffix++) {
188 if (!prefixes.at(prefix).isEmpty() &&
name.startsWith(prefixes.at(prefix)))
190 if (
path.isEmpty() && prefixes.at(prefix).contains(u
'/'))
192 if (!suffixes.at(suffix).isEmpty() &&
name.endsWith(suffixes.at(suffix)))
196 qsizetype lparen = attempt.indexOf(u
'(');
198 lparen = attempt.size();
199 attempt =
path + prefixes.at(prefix) + attempt.insert(lparen, suffixes.at(suffix));
201 attempt =
path + prefixes.at(prefix) +
name + suffixes.at(suffix);
207 auto attemptFromBundle = attempt;
225 QCFType<CFURLRef> bundleUrl = CFURLCreateFromFileSystemRepresentation(NULL,
reinterpret_cast<const UInt8*
>(utf8Bundle.data()), utf8Bundle.length(),
true);
226 QCFType<CFBundleRef> bundle = CFBundleCreate(NULL, bundleUrl);
228 QCFType<CFURLRef>
url = CFBundleCopyExecutableURL(bundle);
229 char executableFile[FILENAME_MAX];
230 CFURLGetFileSystemRepresentation(
url,
true,
reinterpret_cast<UInt8*
>(executableFile), FILENAME_MAX);
247 return (hnd !=
nullptr);
250bool QLibraryPrivate::unload_sys()
252 bool doTryUnload =
true;
258 const char *
error = dlerror();
259#if defined (Q_OS_QNX)
273QFunctionPointer QLibraryPrivate::resolve_sys(
const char *symbol)
Type loadAcquire() const noexcept
void storeRelaxed(Type newValue) noexcept
static QByteArray encodeName(const QString &fileName)
Converts fileName to an 8-bit encoding that you can use in native APIs.
bool exists() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString qualifiedFileName
QAtomicPointer< std::remove_pointer< Handle >::type > pHnd
static QStringList suffixes_sys(const QString &fullVersion)
const QString fullVersion
static QStringList prefixes_sys()
QLibrary::LoadHints loadHints() const
@ ExportExternalSymbolsHint
void reserve(qsizetype size)
void append(parameter_type t)
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
void clear()
Clears the contents of the string and makes it null.
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
QByteArray toUtf8() const &
Combined button and popup list for selecting options.
Q_CORE_EXPORT jint androidSdkVersion()
Q_CORE_EXPORT int qstrcmp(const char *str1, const char *str2)
QList< QString > QStringList
Constructs a string list that contains the given string, str.
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
DBusConnection const char DBusError * error
GLuint GLenum GLenum transform
GLuint GLuint64EXT address
GLsizei const GLchar *const * path
#define qCpuHasFeature(feature)
#define QStringLiteral(str)
QT_BEGIN_NAMESPACE constexpr void qSwap(T &value1, T &value2) noexcept(std::is_nothrow_swappable_v< T >)
QUrl url("example.com")
[constructor-url-reference]