Corelib: s/Q_OS_MAC/Q_OS_DARWIN/wg except for doc and definition

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 <a.samirh78@gmail.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Edward Welbourne 2023-03-17 17:53:51 +01:00
parent adedd3f81d
commit db5279825c
43 changed files with 85 additions and 85 deletions

View File

@ -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");

View File

@ -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
// <initializer_list> or std::move. Let's disable these features

View File

@ -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

View File

@ -33,7 +33,7 @@
# define _PATH_TMP "/tmp"
#endif
#if defined(Q_OS_MAC)
#if defined(Q_OS_DARWIN)
# include <QtCore/private/qcore_mac_p.h>
# include <CoreFoundation/CFBundle.h>
#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()));

View File

@ -18,7 +18,7 @@
#endif
#include <stdio.h>
#include <stdlib.h>
#if defined(Q_OS_MAC)
#if defined(Q_OS_DARWIN)
# include <private/qcore_mac_p.h>
#endif

View File

@ -14,7 +14,7 @@
#include "private/qcore_unix_p.h"
#include "private/qlocking_p.h"
#ifdef Q_OS_MAC
#ifdef Q_OS_DARWIN
#include <private/qcore_mac_p.h>
#endif

View File

@ -44,7 +44,7 @@
# include <shlobj.h>
#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<QBasicMutex> initDefaultPaths(std::unique_lock<QBasicMut
const QString userPath = make_user_path();
pathHash->insert(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

View File

@ -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

View File

@ -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) {

View File

@ -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();

View File

@ -14,7 +14,7 @@
# include <unistd.h>
#endif
#ifdef Q_OS_MAC
#ifdef Q_OS_DARWIN
#include <mach/mach_time.h>
#endif

View File

@ -67,7 +67,7 @@
#include <QtCore/qjniobject.h>
#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

View File

@ -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.");

View File

@ -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%

View File

@ -45,7 +45,7 @@ struct QTimerInfo {
class Q_CORE_EXPORT QTimerInfoList : public QList<QTimerInfo*>
{
#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;

View File

@ -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);

View File

@ -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);

View File

@ -16,7 +16,7 @@
#include <qoperatingsystemversion.h>
#include <qstringlist.h>
#ifdef Q_OS_MAC
#ifdef Q_OS_DARWIN
# include <private/qcore_mac_p.h>
#endif
#include <private/qcoreapplication_p.h>
@ -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

View File

@ -12,7 +12,7 @@
#include <dlfcn.h>
#ifdef Q_OS_MAC
#ifdef Q_OS_DARWIN
# include <private/qcore_mac_p.h>
#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<CFURLRef> bundleUrl = CFURLCreateFromFileSystemRepresentation(NULL, reinterpret_cast<const UInt8*>(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));

View File

@ -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)

View File

@ -25,7 +25,7 @@
#include "qcollator.h"
#include "qttypetraits.h"
#ifdef Q_OS_MAC
#ifdef Q_OS_DARWIN
#include <private/qcore_mac_p.h>
#endif

View File

@ -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"

View File

@ -25,7 +25,7 @@
#include "qplatformdefs.h" // _POSIX_VERSION
#if defined(Q_OS_MAC)
#if defined(Q_OS_DARWIN)
# include <mach/semaphore.h>
#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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -48,7 +48,7 @@ QT_END_NAMESPACE
# include <unistd.h>
# include <private/qcore_unix_p.h>
#endif
#ifdef Q_OS_MAC
#ifdef Q_OS_DARWIN
# include <sys/mount.h>
#elif defined(Q_OS_LINUX)
# include <sys/vfs.h>
@ -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;

View File

@ -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<QString>("path");
QTest::addColumn<bool>("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);

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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" <<true;
#endif
@ -462,7 +462,7 @@ void tst_QLibrary::isLibrary_data()
QTest::newRow("version+.so+version") << QString("liboil-0.3.so.0.1.0") << so_VALID;
// special tests:
#ifdef Q_OS_MAC
#ifdef Q_OS_DARWIN
QTest::newRow("good (libmylib.1.0.0.dylib)") << QString("libmylib.1.0.0.dylib") << true;
QTest::newRow("good (libmylib.dylib)") << QString("libmylib.dylib") << true;
QTest::newRow("good (libmylib.so)") << QString("libmylib.so") << true;
@ -499,7 +499,7 @@ void tst_QLibrary::errorString_data()
#ifdef Q_OS_WIN
QTest::newRow("bad load() with .dll suffix") << (int)Load << QString("nosuchlib.dll") << false << QString("Cannot load library nosuchlib.dll: The specified module could not be found.");
// QTest::newRow("bad unload") << (int)Unload << QString("nosuchlib.dll") << false << QString("QLibrary::unload_sys: Cannot unload nosuchlib.dll (The specified module could not be found.)");
#elif defined Q_OS_MAC
#elif defined Q_OS_DARWIN
#else
QTest::newRow("load invalid file") << (int)Load << QFINDTESTDATA("library_path/invalid.so") << false << QString("Cannot load library.*");
#endif

View File

@ -57,7 +57,7 @@ void tst_QPlugin::loadDebugPlugin()
if (!QLibrary::isLibrary(fileName))
continue;
QPluginLoader loader(dir.filePath(fileName));
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
// we can always load a plugin on unix
QVERIFY(loader.load());
QObject *object = loader.instance();
@ -90,7 +90,7 @@ void tst_QPlugin::loadReleasePlugin()
if (!QLibrary::isLibrary(fileName))
continue;
QPluginLoader loader(dir.filePath(fileName));
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
// we can always load a plugin on unix
QVERIFY(loader.load());
QObject *object = loader.instance();

View File

@ -277,7 +277,7 @@ void tst_QPluginLoader::errorString()
QVERIFY(!unloaded);
}
#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC) && !defined(Q_OS_HPUX)
#if !defined(Q_OS_WIN) && !defined(Q_OS_DARWIN) && !defined(Q_OS_HPUX)
{
QPluginLoader loader( sys_qualifiedLibraryName("almostplugin")); //a plugin with unresolved symbols
loader.setLoadHints(QLibrary::ResolveAllSymbolsHint);

View File

@ -424,7 +424,7 @@ void tst_QUuid::processUniqueness()
QString processTwoOutput;
// Start it once
#ifdef Q_OS_MAC
#ifdef Q_OS_DARWIN
process.start("testProcessUniqueness/testProcessUniqueness.app");
#elif defined(Q_OS_ANDROID)
process.start("libtestProcessUniqueness.so");
@ -435,7 +435,7 @@ void tst_QUuid::processUniqueness()
processOneOutput = process.readAllStandardOutput();
// Start it twice
#ifdef Q_OS_MAC
#ifdef Q_OS_DARWIN
process.start("testProcessUniqueness/testProcessUniqueness.app");
#elif defined(Q_OS_ANDROID)
process.start("libtestProcessUniqueness.so");

View File

@ -2349,7 +2349,7 @@ void tst_QByteArray::isLower()
void tst_QByteArray::macTypes()
{
#ifndef Q_OS_MAC
#ifndef Q_OS_DARWIN
QSKIP("This is a Apple-only test");
#else
extern void tst_QByteArray_macTypes(); // in qbytearray_mac.mm

View File

@ -23,7 +23,7 @@
#include <math.h>
#include <fenv.h>
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
# include <stdlib.h>
#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 <qt_windows.h>

View File

@ -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

View File

@ -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

View File

@ -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