summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2023-03-17 17:21:08 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2023-03-20 19:18:52 +0100
commitadedd3f81d5c46c2f84a1d62ae277d12d9b9b7a7 (patch)
tree61ec505cdc8c210d48253317d873471f591551b7
parent9896ebf93dab37e68d9f1a9392c799b99aed25cd (diff)
QTimeZone: use correct Darwin define in #if-ery
In so far as we support Darwin on tvOS or iOS, it surely makes more sense to use the same code as on macOS for them. This will also avoid further grumbles from the inanity 'bot about the use of the old define. As a drive-by, make the #if-ery on newBackendTimeZone() consistently use parentheses with defined. Change-Id: I6099adfedfc42bba057c8cbfbb38574e2e5d80d7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r--src/corelib/time/qtimezone.cpp8
-rw-r--r--src/corelib/time/qtimezoneprivate_p.h4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/corelib/time/qtimezone.cpp b/src/corelib/time/qtimezone.cpp
index 558bda030e..58f0de3047 100644
--- a/src/corelib/time/qtimezone.cpp
+++ b/src/corelib/time/qtimezone.cpp
@@ -29,7 +29,7 @@ static QTimeZonePrivate *newBackendTimeZone()
return new QUtcTimeZonePrivate();
#endif
#else
-#if defined Q_OS_MAC
+#if defined(Q_OS_DARWIN)
return new QMacTimeZonePrivate();
#elif defined(Q_OS_ANDROID)
return new QAndroidTimeZonePrivate();
@@ -37,7 +37,7 @@ static QTimeZonePrivate *newBackendTimeZone()
return new QTzTimeZonePrivate();
#elif QT_CONFIG(icu)
return new QIcuTimeZonePrivate();
-#elif defined Q_OS_WIN
+#elif defined(Q_OS_WIN)
return new QWinTimeZonePrivate();
#else
return new QUtcTimeZonePrivate();
@@ -56,7 +56,7 @@ static QTimeZonePrivate *newBackendTimeZone(const QByteArray &ianaId)
return new QUtcTimeZonePrivate(ianaId);
#endif
#else
-#if defined Q_OS_MAC
+#if defined(Q_OS_DARWIN)
return new QMacTimeZonePrivate(ianaId);
#elif defined(Q_OS_ANDROID)
return new QAndroidTimeZonePrivate(ianaId);
@@ -64,7 +64,7 @@ static QTimeZonePrivate *newBackendTimeZone(const QByteArray &ianaId)
return new QTzTimeZonePrivate(ianaId);
#elif QT_CONFIG(icu)
return new QIcuTimeZonePrivate(ianaId);
-#elif defined Q_OS_WIN
+#elif defined(Q_OS_WIN)
return new QWinTimeZonePrivate(ianaId);
#else
return new QUtcTimeZonePrivate(ianaId);
diff --git a/src/corelib/time/qtimezoneprivate_p.h b/src/corelib/time/qtimezoneprivate_p.h
index 27d77f3d58..3cc9fcbcba 100644
--- a/src/corelib/time/qtimezoneprivate_p.h
+++ b/src/corelib/time/qtimezoneprivate_p.h
@@ -334,7 +334,7 @@ private:
};
#endif // Q_OS_UNIX
-#ifdef Q_OS_MAC
+#ifdef Q_OS_DARWIN
class Q_AUTOTEST_EXPORT QMacTimeZonePrivate final : public QTimeZonePrivate
{
public:
@@ -377,7 +377,7 @@ private:
NSTimeZone *m_nstz;
};
-#endif // Q_OS_MAC
+#endif // Q_OS_DARWIN
#ifdef Q_OS_WIN
class Q_AUTOTEST_EXPORT QWinTimeZonePrivate final : public QTimeZonePrivate