From db5279825cd0f2e87e59a540844059bc5d30ce94 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 17 Mar 2023 17:53:51 +0100 Subject: [PATCH] Corelib: s/Q_OS_MAC/Q_OS_DARWIN/wg except for doc and definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I got tired of being told off by the inanity 'bot for faithfully reflecting existing #if-ery in new #if-ery. Retain only the documentation and definition of the deprecated define. Change-Id: I47f47b76bd239a360f27ae5afe593dfad8746538 Reviewed-by: Ahmad Samir Reviewed-by: Tor Arne Vestbø --- .../snippets/code/src_corelib_io_qsettings.cpp | 2 +- src/corelib/global/qcompilerdetection.h | 2 +- src/corelib/io/qdebug.h | 4 ++-- src/corelib/io/qfilesystemengine_unix.cpp | 4 ++-- src/corelib/io/qfsfileengine.cpp | 2 +- src/corelib/io/qprocess_unix.cpp | 2 +- src/corelib/io/qsettings.cpp | 12 ++++++------ src/corelib/io/qsettings_p.h | 2 +- src/corelib/io/qstandardpaths.cpp | 2 +- src/corelib/io/qstorageinfo_p.h | 2 +- src/corelib/kernel/qcore_unix.cpp | 2 +- src/corelib/kernel/qcoreapplication.cpp | 4 ++-- src/corelib/kernel/qobject.cpp | 2 +- src/corelib/kernel/qtimerinfo_unix.cpp | 4 ++-- src/corelib/kernel/qtimerinfo_unix_p.h | 2 +- src/corelib/plugin/qfactoryloader.cpp | 4 ++-- src/corelib/plugin/qfactoryloader_p.h | 4 ++-- src/corelib/plugin/qlibrary.cpp | 4 ++-- src/corelib/plugin/qlibrary_unix.cpp | 8 ++++---- src/corelib/plugin/qplugin.h | 2 +- src/corelib/text/qstring.cpp | 2 +- src/corelib/thread/qmutex.cpp | 2 +- src/corelib/thread/qmutex_p.h | 4 ++-- src/corelib/thread/qthread_unix.cpp | 6 +++--- src/corelib/thread/qwaitcondition_unix.cpp | 4 ++-- src/corelib/tools/qsharedpointer.cpp | 2 +- .../corelib/io/largefile/tst_largefile.cpp | 6 +++--- tests/auto/corelib/io/qdir/tst_qdir.cpp | 2 +- tests/auto/corelib/io/qfile/tst_qfile.cpp | 4 ++-- .../corelib/io/qfileinfo/tst_qfileinfo.cpp | 18 +++++++++--------- .../tst_qfilesystemwatcher.cpp | 2 +- .../auto/corelib/io/qprocess/tst_qprocess.cpp | 2 +- .../corelib/io/qsettings/tst_qsettings.cpp | 12 ++++++------ tests/auto/corelib/io/qurl/tst_qurl.cpp | 2 +- .../corelib/plugin/qlibrary/tst_qlibrary.cpp | 6 +++--- .../corelib/plugin/qplugin/tst_qplugin.cpp | 4 ++-- .../plugin/qpluginloader/tst_qpluginloader.cpp | 2 +- tests/auto/corelib/plugin/quuid/tst_quuid.cpp | 4 ++-- .../corelib/text/qbytearray/tst_qbytearray.cpp | 2 +- .../auto/corelib/text/qlocale/tst_qlocale.cpp | 8 ++++---- .../auto/corelib/text/qstring/tst_qstring.cpp | 2 +- .../qfuturewatcher/tst_qfuturewatcher.cpp | 2 +- .../corelib/time/qdatetime/tst_qdatetime.cpp | 2 +- 43 files changed, 85 insertions(+), 85 deletions(-) diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp index cc93e32d05a..92e40c36677 100644 --- a/src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_io_qsettings.cpp @@ -45,7 +45,7 @@ settings.value("HKEY_CURRENT_USER\\MySoft\\Star Runner\\Galaxy\\Default"); // re //! [7] -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN QSettings settings("grenoullelogique.fr", "Squash"); #else QSettings settings("Grenoulle Logique", "Squash"); diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index cb91b82fa70..cbea1a80248 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -891,7 +891,7 @@ # endif // !_HAS_CONSTEXPR # endif // !__GLIBCXX__ && !_LIBCPP_VERSION # endif // Q_OS_QNX -# if defined(Q_CC_CLANG) && defined(Q_OS_MAC) && defined(__GNUC_LIBSTD__) \ +# if defined(Q_CC_CLANG) && defined(Q_OS_DARWIN) && defined(__GNUC_LIBSTD__) \ && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402) // Apple has not updated libstdc++ since 2007, which means it does not have // or std::move. Let's disable these features diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index a55a6ad100d..e39f9afd316 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -528,7 +528,7 @@ inline QDebug operator<<(QDebug debug, QKeyCombination combination) return debug; } -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN // We provide QDebug stream operators for commonly used Core Foundation // and Core Graphics types, as well as NSObject. Additional CF/CG types @@ -607,7 +607,7 @@ QT_FOR_EACH_MUTABLE_CORE_GRAPHICS_TYPE(QT_FORWARD_DECLARE_QDEBUG_OPERATOR_FOR_CF #undef QT_FORWARD_DECLARE_CG_TYPE #undef QT_FORWARD_DECLARE_MUTABLE_CG_TYPE -#endif // Q_OS_MAC +#endif // Q_OS_DARWIN QT_END_NAMESPACE diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index fba86672908..d94cd452cfe 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -33,7 +33,7 @@ # define _PATH_TMP "/tmp" #endif -#if defined(Q_OS_MAC) +#if defined(Q_OS_DARWIN) # include # include #endif @@ -644,7 +644,7 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry, { Q_CHECK_FILE_NAME(entry, entry); -#if !defined(Q_OS_MAC) && !defined(Q_OS_QNX) && !defined(Q_OS_ANDROID) && !defined(Q_OS_HAIKU) && _POSIX_VERSION < 200809L +#if !defined(Q_OS_DARWIN) && !defined(Q_OS_QNX) && !defined(Q_OS_ANDROID) && !defined(Q_OS_HAIKU) && _POSIX_VERSION < 200809L // realpath(X,0) is not supported Q_UNUSED(data); return QFileSystemEntry(slowCanonicalized(absoluteName(entry).filePath())); diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp index ffc4878e0dd..0ff7da1ac4e 100644 --- a/src/corelib/io/qfsfileengine.cpp +++ b/src/corelib/io/qfsfileengine.cpp @@ -18,7 +18,7 @@ #endif #include #include -#if defined(Q_OS_MAC) +#if defined(Q_OS_DARWIN) # include #endif diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 7607901021a..27c1403226d 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -14,7 +14,7 @@ #include "private/qcore_unix_p.h" #include "private/qlocking_p.h" -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN #include #endif diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 3f332393341..0b28690a4ea 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -44,7 +44,7 @@ # include #endif -#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) +#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN) && !defined(Q_OS_ANDROID) #define Q_XDG_PLATFORM #endif @@ -270,7 +270,7 @@ QString QSettingsPrivate::normalizedKey(QAnyStringView key) // see also qsettings_win.cpp and qsettings_mac.cpp -#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC) && !defined(Q_OS_WASM) +#if !defined(Q_OS_WIN) && !defined(Q_OS_DARWIN) && !defined(Q_OS_WASM) QSettingsPrivate *QSettingsPrivate::create(QSettings::Format format, QSettings::Scope scope, const QString &organization, const QString &application) { @@ -881,7 +881,7 @@ void QConfFileSettingsPrivate::initFormat() extension = (format == QSettings::NativeFormat) ? ".conf"_L1 : ".ini"_L1; readFunc = nullptr; writeFunc = nullptr; -#if defined(Q_OS_MAC) +#if defined(Q_OS_DARWIN) caseSensitivity = (format == QSettings::NativeFormat) ? Qt::CaseSensitive : IniCaseSensitivity; #else caseSensitivity = IniCaseSensitivity; @@ -998,7 +998,7 @@ static std::unique_lock initDefaultPaths(std::unique_lockinsert(pathHashKey(QSettings::IniFormat, QSettings::UserScope), Path(userPath, false)); pathHash->insert(pathHashKey(QSettings::IniFormat, QSettings::SystemScope), Path(systemPath, false)); -#ifndef Q_OS_MAC +#ifndef Q_OS_DARWIN pathHash->insert(pathHashKey(QSettings::NativeFormat, QSettings::UserScope), Path(userPath, false)); pathHash->insert(pathHashKey(QSettings::NativeFormat, QSettings::SystemScope), Path(systemPath, false)); #endif @@ -1372,7 +1372,7 @@ void QConfFileSettingsPrivate::syncConfFile(QConfFile *confFile) */ if (file.isReadable() && file.size() != 0) { bool ok = false; -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN if (format == QSettings::NativeFormat) { QByteArray data = file.readAll(); ok = readPlistFile(data, &confFile->originalKeys); @@ -1428,7 +1428,7 @@ void QConfFileSettingsPrivate::syncConfFile(QConfFile *confFile) return; } -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN if (format == QSettings::NativeFormat) { ok = writePlistFile(sf, mergedKeys); } else diff --git a/src/corelib/io/qsettings_p.h b/src/corelib/io/qsettings_p.h index 24298202422..d79c10e6435 100644 --- a/src/corelib/io/qsettings_p.h +++ b/src/corelib/io/qsettings_p.h @@ -248,7 +248,7 @@ private: virtual void initAccess(); void syncConfFile(QConfFile *confFile); bool writeIniFile(QIODevice &device, const ParsedSettingsMap &map); -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN bool readPlistFile(const QByteArray &data, ParsedSettingsMap *map) const; bool writePlistFile(QIODevice &file, const ParsedSettingsMap &map) const; #endif diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp index a20c50e096c..9a14ae0717f 100644 --- a/src/corelib/io/qstandardpaths.cpp +++ b/src/corelib/io/qstandardpaths.cpp @@ -523,7 +523,7 @@ QString QStandardPaths::findExecutable(const QString &executableName, const QStr \include standardpath/functiondocs.qdocinc displayName */ -#if !defined(Q_OS_MAC) && !defined(QT_BOOTSTRAPPED) +#if !defined(Q_OS_DARWIN) && !defined(QT_BOOTSTRAPPED) QString QStandardPaths::displayName(StandardLocation type) { switch (type) { diff --git a/src/corelib/io/qstorageinfo_p.h b/src/corelib/io/qstorageinfo_p.h index d6d0ab28086..aba8e32029c 100644 --- a/src/corelib/io/qstorageinfo_p.h +++ b/src/corelib/io/qstorageinfo_p.h @@ -40,7 +40,7 @@ protected: void retrieveDiskFreeSpace(); bool queryStorageProperty(); void queryFileFsSectorSizeInformation(); -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_DARWIN) void retrievePosixInfo(); void retrieveUrlProperties(bool initRootPath = false); void retrieveLabel(); diff --git a/src/corelib/kernel/qcore_unix.cpp b/src/corelib/kernel/qcore_unix.cpp index 570e3056ab5..4a95080c199 100644 --- a/src/corelib/kernel/qcore_unix.cpp +++ b/src/corelib/kernel/qcore_unix.cpp @@ -14,7 +14,7 @@ # include #endif -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN #include #endif diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 3feb4cf4c4b..e40cab05ba9 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -67,7 +67,7 @@ #include #endif -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN # include "qcore_mac_p.h" #endif @@ -122,7 +122,7 @@ Q_TRACE_POINT(qtcore, QCoreApplication_sendSpontaneousEvent, QObject *receiver, Q_TRACE_POINT(qtcore, QCoreApplication_notify_entry, QObject *receiver, QEvent *event, QEvent::Type type); Q_TRACE_POINT(qtcore, QCoreApplication_notify_exit, bool consumed, bool filtered); -#if defined(Q_OS_WIN) || defined(Q_OS_MAC) +#if defined(Q_OS_WIN) || defined(Q_OS_DARWIN) extern QString qAppFileName(); #endif diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 6b7a5dafcb4..8293b819a06 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -1636,7 +1636,7 @@ void QObject::moveToThread(QThread *targetThread) "Cannot move to target thread (%p)\n", currentData->thread.loadRelaxed(), thisThreadData->thread.loadRelaxed(), targetData ? targetData->thread.loadRelaxed() : nullptr); -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN qWarning("You might be loading two sets of Qt binaries into the same process. " "Check that all plugins are compiled against the right Qt binaries. Export " "DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded."); diff --git a/src/corelib/kernel/qtimerinfo_unix.cpp b/src/corelib/kernel/qtimerinfo_unix.cpp index 744f9f1fce7..f3d811a948a 100644 --- a/src/corelib/kernel/qtimerinfo_unix.cpp +++ b/src/corelib/kernel/qtimerinfo_unix.cpp @@ -30,7 +30,7 @@ Q_CORE_EXPORT bool qt_disable_lowpriority_timers=false; QTimerInfoList::QTimerInfoList() { -#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_MAC) +#if (_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_DARWIN) if (!QElapsedTimer::isMonotonic()) { // not using monotonic timers, initialize the timeChanged() machinery previousTime = qt_gettime(); @@ -57,7 +57,7 @@ timespec QTimerInfoList::updateCurrentTime() return (currentTime = qt_gettime()); } -#if ((_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_MAC) && !defined(Q_OS_INTEGRITY)) || defined(QT_BOOTSTRAPPED) +#if ((_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_DARWIN) && !defined(Q_OS_INTEGRITY)) || defined(QT_BOOTSTRAPPED) /* Returns \c true if the real time clock has changed by more than 10% diff --git a/src/corelib/kernel/qtimerinfo_unix_p.h b/src/corelib/kernel/qtimerinfo_unix_p.h index 1addaf0eaa3..c1c1f3474ae 100644 --- a/src/corelib/kernel/qtimerinfo_unix_p.h +++ b/src/corelib/kernel/qtimerinfo_unix_p.h @@ -45,7 +45,7 @@ struct QTimerInfo { class Q_CORE_EXPORT QTimerInfoList : public QList { -#if ((_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_MAC)) || defined(QT_BOOTSTRAPPED) +#if ((_POSIX_MONOTONIC_CLOCK-0 <= 0) && !defined(Q_OS_DARWIN)) || defined(QT_BOOTSTRAPPED) timespec previousTime; clock_t previousTicks; int ticksPerSecond; diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 1e7b54d1696..669949b975b 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -161,7 +161,7 @@ inline void QFactoryLoaderPrivate::updateSinglePath(const QString &path) while (plugins.hasNext()) { QString fileName = plugins.next(); -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN const bool isDebugPlugin = fileName.endsWith("_debug.dylib"_L1); const bool isDebugLibrary = #ifdef QT_DEBUG @@ -266,7 +266,7 @@ QFactoryLoader::~QFactoryLoader() } } -#if defined(Q_OS_UNIX) && !defined (Q_OS_MAC) +#if defined(Q_OS_UNIX) && !defined (Q_OS_DARWIN) QLibraryPrivate *QFactoryLoader::library(const QString &key) const { Q_D(const QFactoryLoader); diff --git a/src/corelib/plugin/qfactoryloader_p.h b/src/corelib/plugin/qfactoryloader_p.h index 0c8f9777078..fcfb4cf5977 100644 --- a/src/corelib/plugin/qfactoryloader_p.h +++ b/src/corelib/plugin/qfactoryloader_p.h @@ -74,9 +74,9 @@ public: void update(); static void refreshAll(); -#if defined(Q_OS_UNIX) && !defined (Q_OS_MAC) +#if defined(Q_OS_UNIX) && !defined (Q_OS_DARWIN) QLibraryPrivate *library(const QString &key) const; -#endif // Q_OS_UNIX && !Q_OS_MAC +#endif // Q_OS_UNIX && !Q_OS_DARWIN #endif // QT_CONFIG(library) void setExtraSearchPath(const QString &path); diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index d4f9235538f..5459ae15b07 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -16,7 +16,7 @@ #include #include -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN # include #endif #include @@ -712,7 +712,7 @@ void QLibraryPrivate::updatePluginState() bool success = false; -#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) +#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN) if (fileName.endsWith(".debug"_L1)) { // refuse to load a file that ends in .debug // these are the debug symbols from the libraries diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp index 74783730d27..4ca205bb7d6 100644 --- a/src/corelib/plugin/qlibrary_unix.cpp +++ b/src/corelib/plugin/qlibrary_unix.cpp @@ -12,7 +12,7 @@ #include -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN # include #endif @@ -72,7 +72,7 @@ QStringList QLibraryPrivate::suffixes_sys(const QString &fullVersion) # endif } #endif -# ifdef Q_OS_MAC +# ifdef Q_OS_DARWIN if (!fullVersion.isEmpty()) { suffixes << ".%1.bundle"_L1.arg(fullVersion); suffixes << ".%1.dylib"_L1.arg(fullVersion); @@ -233,7 +233,7 @@ bool QLibraryPrivate::load_sys() } } -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN if (!hnd) { QByteArray utf8Bundle = fileName.toUtf8(); QCFType bundleUrl = CFURLCreateFromFileSystemRepresentation(NULL, reinterpret_cast(utf8Bundle.data()), utf8Bundle.length(), true); @@ -285,7 +285,7 @@ Q_CORE_EXPORT QFunctionPointer qt_linux_find_symbol_sys(const char *symbol) } #endif -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN Q_CORE_EXPORT QFunctionPointer qt_mac_resolve_sys(void *handle, const char *symbol) { return QFunctionPointer(dlsym(handle, symbol)); diff --git a/src/corelib/plugin/qplugin.h b/src/corelib/plugin/qplugin.h index 30f5cbb92f3..909c8acdcc2 100644 --- a/src/corelib/plugin/qplugin.h +++ b/src/corelib/plugin/qplugin.h @@ -127,7 +127,7 @@ void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin staticPlugin); #if defined(Q_OF_ELF) || (defined(Q_OS_WIN) && (defined (Q_CC_GNU) || defined(Q_CC_CLANG))) # define QT_PLUGIN_METADATA_SECTION \ __attribute__ ((section (".qtmetadata"))) __attribute__((used)) -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_DARWIN) # define QT_PLUGIN_METADATA_SECTION \ __attribute__ ((section ("__TEXT,qtmetadata"))) __attribute__((used)) #elif defined(Q_CC_MSVC) diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 4b7535505ae..64ad2c537b3 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -25,7 +25,7 @@ #include "qcollator.h" #include "qttypetraits.h" -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN #include #endif diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp index 7b4aac9532f..293a4a772a2 100644 --- a/src/corelib/thread/qmutex.cpp +++ b/src/corelib/thread/qmutex.cpp @@ -867,7 +867,7 @@ QT_END_NAMESPACE #if defined(QT_ALWAYS_USE_FUTEX) // nothing -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_DARWIN) # include "qmutex_mac.cpp" #else # include "qmutex_unix.cpp" diff --git a/src/corelib/thread/qmutex_p.h b/src/corelib/thread/qmutex_p.h index 66d902d1c37..13a9f10b019 100644 --- a/src/corelib/thread/qmutex_p.h +++ b/src/corelib/thread/qmutex_p.h @@ -25,7 +25,7 @@ #include "qplatformdefs.h" // _POSIX_VERSION -#if defined(Q_OS_MAC) +#if defined(Q_OS_DARWIN) # include #elif defined(Q_OS_UNIX) # if _POSIX_VERSION-0 >= 200112L || _XOPEN_VERSION-0 >= 600 @@ -85,7 +85,7 @@ public: void derefWaiters(int value) noexcept; //platform specific stuff -#if defined(Q_OS_MAC) +#if defined(Q_OS_DARWIN) semaphore_t mach_semaphore; #elif defined(QT_UNIX_SEMAPHORE) sem_t semaphore; diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index 47eb7e68223..ee66e1c3c31 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -237,12 +237,12 @@ QAbstractEventDispatcher *QThreadPrivate::createEventDispatcher(QThreadData *dat #if QT_CONFIG(thread) -#if (defined(Q_OS_LINUX) || defined(Q_OS_MAC) || defined(Q_OS_QNX)) +#if (defined(Q_OS_LINUX) || defined(Q_OS_DARWIN) || defined(Q_OS_QNX)) static void setCurrentThreadName(const char *name) { # if defined(Q_OS_LINUX) && !defined(QT_LINUXBASE) prctl(PR_SET_NAME, (unsigned long)name, 0, 0, 0); -# elif defined(Q_OS_MAC) +# elif defined(Q_OS_DARWIN) pthread_setname_np(name); # elif defined(Q_OS_QNX) pthread_setname_np(pthread_self(), name); @@ -304,7 +304,7 @@ void *QThreadPrivate::start(void *arg) data->ensureEventDispatcher(); data->eventDispatcher.loadRelaxed()->startingUp(); -#if (defined(Q_OS_LINUX) || defined(Q_OS_MAC) || defined(Q_OS_QNX)) +#if (defined(Q_OS_LINUX) || defined(Q_OS_DARWIN) || defined(Q_OS_QNX)) { // Sets the name of the current thread. We can only do this // when the thread is starting, as we don't have a cross diff --git a/src/corelib/thread/qwaitcondition_unix.cpp b/src/corelib/thread/qwaitcondition_unix.cpp index 4d27e47c3eb..84534e9de12 100644 --- a/src/corelib/thread/qwaitcondition_unix.cpp +++ b/src/corelib/thread/qwaitcondition_unix.cpp @@ -48,7 +48,7 @@ void qt_initialize_pthread_cond(pthread_cond_t *cond, const char *where) #if defined(Q_OS_ANDROID) if (local_condattr_setclock && QElapsedTimer::clockType() == QElapsedTimer::MonotonicClock) local_condattr_setclock(&condattr, CLOCK_MONOTONIC); -#elif !defined(Q_OS_MAC) +#elif !defined(Q_OS_DARWIN) if (QElapsedTimer::clockType() == QElapsedTimer::MonotonicClock) pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC); #endif @@ -59,7 +59,7 @@ void qt_initialize_pthread_cond(pthread_cond_t *cond, const char *where) void qt_abstime_for_timeout(timespec *ts, QDeadlineTimer deadline) { -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN // on Mac, qt_gettime() (on qelapsedtimer_mac.cpp) returns ticks related to the Mach absolute time // that doesn't work with pthread // Mac also doesn't have clock_gettime diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp index 3fa9bbd0d81..7ed38471828 100644 --- a/src/corelib/tools/qsharedpointer.cpp +++ b/src/corelib/tools/qsharedpointer.cpp @@ -1463,7 +1463,7 @@ QT_END_NAMESPACE # ifdef QT_SHARED_POINTER_BACKTRACE_SUPPORT # if defined(__GLIBC__) && (__GLIBC__ >= 2) && !defined(__UCLIBC__) && !defined(QT_LINUXBASE) # define BACKTRACE_SUPPORTED -# elif defined(Q_OS_MAC) +# elif defined(Q_OS_DARWIN) # define BACKTRACE_SUPPORTED # endif # endif diff --git a/tests/auto/corelib/io/largefile/tst_largefile.cpp b/tests/auto/corelib/io/largefile/tst_largefile.cpp index a9108c577f7..b09d6b6f502 100644 --- a/tests/auto/corelib/io/largefile/tst_largefile.cpp +++ b/tests/auto/corelib/io/largefile/tst_largefile.cpp @@ -37,9 +37,7 @@ public: , fd_(-1) , stream_(0) { - #if defined(QT_LARGEFILE_SUPPORT) && !defined(Q_OS_MAC) && !defined(Q_OS_QNX) - maxSizeBits = 36; // 64 GiB - #elif defined(Q_OS_MAC) + #if defined(Q_OS_DARWIN) // HFS+ does not support sparse files, so we limit file size for the test // on Mac OS. maxSizeBits = 24; // 16 MiB @@ -48,6 +46,8 @@ public: // This means that files are limited to 2 GB − 1 bytes. // Limit max size to 256MB maxSizeBits = 28; // 256 MiB + #elif defined(QT_LARGEFILE_SUPPORT) + maxSizeBits = 36; // 64 GiB #else maxSizeBits = 24; // 16 MiB #endif diff --git a/tests/auto/corelib/io/qdir/tst_qdir.cpp b/tests/auto/corelib/io/qdir/tst_qdir.cpp index bce19430cee..d7b0d2b1c11 100644 --- a/tests/auto/corelib/io/qdir/tst_qdir.cpp +++ b/tests/auto/corelib/io/qdir/tst_qdir.cpp @@ -1621,7 +1621,7 @@ void tst_QDir::rename() QDir dir; QVERIFY(dir.rename("rename-test", "rename-test-renamed")); QVERIFY(dir.rename("rename-test-renamed", "rename-test")); -#if defined(Q_OS_MAC) +#if defined(Q_OS_DARWIN) QVERIFY(!dir.rename("rename-test", "/etc/rename-test-renamed")); #elif !defined(Q_OS_WIN) // on windows this is possible - maybe make the test a bit better diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index a7b3464fd6f..65011ec5bba 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -48,7 +48,7 @@ QT_END_NAMESPACE # include # include #endif -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN # include #elif defined(Q_OS_LINUX) # include @@ -3605,7 +3605,7 @@ void tst_QFile::caseSensitivity() { #if defined(Q_OS_WIN) const bool caseSensitive = false; -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_DARWIN) const bool caseSensitive = pathconf(QDir::currentPath().toLatin1().constData(), _PC_CASE_SENSITIVE); #else const bool caseSensitive = true; diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index abd4dfed5e3..c9db19db224 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -201,7 +201,7 @@ private slots: void isHidden_data(); void isHidden(); -#if defined(Q_OS_MAC) +#if defined(Q_OS_DARWIN) void isHiddenFromFinder(); #endif @@ -762,7 +762,7 @@ void tst_QFileInfo::bundleName_data() QTest::newRow("root") << "/" << ""; QTest::newRow("etc") << "/etc" << ""; -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN QTest::newRow("safari") << "/Applications/Safari.app" << "Safari"; #endif } @@ -1019,7 +1019,7 @@ void tst_QFileInfo::compare_data() << m_sourceFile #if defined(Q_OS_WIN) << true; -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_DARWIN) << !pathconf(QDir::currentPath().toLatin1().constData(), _PC_CASE_SENSITIVE); #else << false; @@ -1028,7 +1028,7 @@ void tst_QFileInfo::compare_data() void tst_QFileInfo::compare() { -#if defined(Q_OS_MAC) +#if defined(Q_OS_DARWIN) if (qstrcmp(QTest::currentDataTag(), "casesense1") == 0) QSKIP("Qt thinks all UNIX filesystems are case sensitive, see QTBUG-28246"); #endif @@ -1535,14 +1535,14 @@ void tst_QFileInfo::isHidden_data() QTest::newRow("/path/to/.hidden-directory/..") << QDir::currentPath() + QString("/.hidden-directory/..") << true; #endif -#if defined(Q_OS_MAC) +#if defined(Q_OS_DARWIN) // /bin has the hidden attribute on OS X QTest::newRow("/bin/") << QString::fromLatin1("/bin/") << true; #elif !defined(Q_OS_WIN) QTest::newRow("/bin/") << QString::fromLatin1("/bin/") << false; #endif -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN QTest::newRow("mac_etc") << QString::fromLatin1("/etc") << true; QTest::newRow("mac_private_etc") << QString::fromLatin1("/private/etc") << false; QTest::newRow("mac_Applications") << QString::fromLatin1("/Applications") << false; @@ -1558,7 +1558,7 @@ void tst_QFileInfo::isHidden() QCOMPARE(fi.isHidden(), isHidden); } -#if defined(Q_OS_MAC) +#if defined(Q_OS_DARWIN) void tst_QFileInfo::isHiddenFromFinder() { const char *filename = "test_foobar.txt"; @@ -1584,7 +1584,7 @@ void tst_QFileInfo::isBundle_data() QTest::addColumn("path"); QTest::addColumn("isBundle"); QTest::newRow("root") << QString::fromLatin1("/") << false; -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN QTest::newRow("mac_Applications") << QString::fromLatin1("/Applications") << false; QTest::newRow("mac_Applications") << QString::fromLatin1("/Applications/Safari.app") << true; #endif @@ -2007,7 +2007,7 @@ private: void tst_QFileInfo::testDecomposedUnicodeNames() { -#ifndef Q_OS_MAC +#ifndef Q_OS_DARWIN QSKIP("This is a OS X only test (unless you know more about filesystems, then maybe you should try it ;)"); #else QFETCH(QString, filePath); diff --git a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index dfdf4e05c1e..8438e904d17 100644 --- a/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -563,7 +563,7 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory() QVERIFY2(testFile.write(QByteArrayLiteral("hello again")), msgFileOperationFailed("write", testFile)); testFile.close(); -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN // wait again for the file's atime to be updated QTest::qWait(2000); #endif diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index 992d3ff0c78..2d9242a1188 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -1501,7 +1501,7 @@ void tst_QProcess::failToStart() // to many processes here will cause test failures later on. #if defined Q_OS_HPUX const int attempts = 15; -#elif defined Q_OS_MAC +#elif defined Q_OS_DARWIN const int attempts = 15; #else const int attempts = 50; diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index bf1c165b4f1..2994b32dc16 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -131,7 +131,7 @@ private slots: void testRegistryShortRootNames(); void testRegistry32And64Bit(); void trailingWhitespace(); -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN void fileName(); #endif void isWritable_data() { populateWithFormats(); } @@ -497,7 +497,7 @@ void tst_QSettings::ctor() QSettings settings5(format, QSettings::UserScope, "SoftWare.ORG", "killerApp"); bool caseSensitive = true; -#if defined(Q_OS_MAC) +#if defined(Q_OS_DARWIN) if (format == QSettings::NativeFormat) { // more details in QMacSettingsPrivate::QMacSettingsPrivate(), organization was comify()-ed caseSensitive = settings5.fileName().contains("SoftWare.ORG");; @@ -578,7 +578,7 @@ void tst_QSettings::ctor() QCoreApplication::instance()->setOrganizationName(""); QCoreApplication::instance()->setApplicationName(""); QSettings settings; -#if defined(Q_OS_MAC) +#if defined(Q_OS_DARWIN) QEXPECT_FAIL("native", "Default settings on Mac are valid, despite organization domain, name, and app name being null", Continue); #endif QCOMPARE(settings.status(), QSettings::AccessError); @@ -593,7 +593,7 @@ void tst_QSettings::ctor() } QSettings settings(format, QSettings::UserScope, "", ""); -#if defined(Q_OS_MAC) +#if defined(Q_OS_DARWIN) QEXPECT_FAIL("native", "Default settings on Mac are valid, despite organization domain, name, and app name being null", Continue); #endif QCOMPARE(settings.status(), QSettings::AccessError); @@ -2902,7 +2902,7 @@ void tst_QSettings::testCaseSensitivity() } } -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN // Please write a fileName() test for the other platforms void tst_QSettings::fileName() { @@ -3310,7 +3310,7 @@ void tst_QSettings::setPath() path checks that it has no bad side effects. */ for (int i = 0; i < 2; ++i) { -#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC) +#if !defined(Q_OS_WIN) && !defined(Q_OS_DARWIN) TEST_PATH(i == 0, "conf", NativeFormat, UserScope, "alpha") TEST_PATH(i == 0, "conf", NativeFormat, SystemScope, "beta") #endif diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp index 070c0c53184..2de0d541249 100644 --- a/tests/auto/corelib/io/qurl/tst_qurl.cpp +++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp @@ -1387,7 +1387,7 @@ void tst_QUrl::fromLocalFileNormalize() void tst_QUrl::macTypes() { -#ifndef Q_OS_MAC +#ifndef Q_OS_DARWIN QSKIP("This is a Mac-only test"); #else extern void tst_QUrl_mactypes(); // in tst_qurl_mac.mm diff --git a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp index 018756e81e4..39e47b87725 100644 --- a/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp +++ b/tests/auto/corelib/plugin/qlibrary/tst_qlibrary.cpp @@ -273,7 +273,7 @@ void tst_QLibrary::load_data() QTest::newRow( "notexist" ) << appDir + "/nolib" << false; QTest::newRow( "badlibrary" ) << appDir + "/qlibrary.pro" << false; -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN QTest::newRow("ok (libmylib ver. 1)") << appDir + "/libmylib" < #include -#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) +#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN) # include #endif @@ -43,7 +43,7 @@ private slots: #if defined(Q_OS_WIN) void windowsDefaultLocale(); #endif -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN void macDefaultLocale(); #endif @@ -2241,7 +2241,7 @@ void tst_QLocale::integerRoundTrip() QCOMPARE(locale.toString(number), numberText); } -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN // Format number string according to system locale settings. // Expected in format is US "1,234.56". @@ -2343,7 +2343,7 @@ void tst_QLocale::macDefaultLocale() QCOMPARE(locale.weekdays(), days); } -#endif // Q_OS_MAC +#endif // Q_OS_DARWIN #if defined(Q_OS_WIN) #include diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp index ecbda7fd910..7038512cd2c 100644 --- a/tests/auto/corelib/text/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp @@ -1393,7 +1393,7 @@ void tst_QString::STL() void tst_QString::macTypes() { -#ifndef Q_OS_MAC +#ifndef Q_OS_DARWIN QSKIP("This is a Mac-only test"); #else extern void tst_QString_macTypes(); // in qcore_foundation.mm diff --git a/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp b/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp index 07e34b130a5..62a9ab40e74 100644 --- a/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp +++ b/tests/auto/corelib/thread/qfuturewatcher/tst_qfuturewatcher.cpp @@ -1140,7 +1140,7 @@ public: void tst_QFutureWatcher::warnRace() { -#ifndef Q_OS_MAC //I don't know why it is not working on mac +#ifndef Q_OS_DARWIN // I don't know why it is not working on mac #ifndef QT_NO_DEBUG QTest::ignoreMessage(QtWarningMsg, "QFutureWatcher::connect: connecting after calling setFuture() is likely to produce race"); #endif diff --git a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp index 0b165f791a4..e4e8d8f7eaf 100644 --- a/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/time/qdatetime/tst_qdatetime.cpp @@ -4307,7 +4307,7 @@ void tst_QDateTime::range() const void tst_QDateTime::macTypes() { -#ifndef Q_OS_MAC +#ifndef Q_OS_DARWIN QSKIP("This is a Apple-only test"); #else extern void tst_QDateTime_macTypes(); // in qdatetime_mac.mm