diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2023-02-22 13:10:34 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2023-04-18 19:23:39 -0300 |
commit | 840af18b8da2d903ea773cd135800734f93724a8 (patch) | |
tree | e534571b20513efb7c56f1345b31c4e019d02c15 /src/corelib/kernel/qdeadlinetimer.cpp | |
parent | 4c34894075bc58023f6e52830739cf3c4d259614 (diff) |
QElapsedTimer/Darwin: merge with the Unix implementation
Old versions of the Apple operating systems did not implement the POSIX
realtime monotonic clock, so we used the Mach absolute timer. The LLVM
libc++ implementation[1] unconditionally uses CLOCK_MONOTONIC_RAW on
these OSes:
* macOS >= 10.12
* iPhoneOS >= 10.0
* tvOS >= 10.0
* watchOS >= 3.0
Qt 6 doesn't support the latter two and the former two are much older
than what we require, so we can use this functionality too.
[1] https://github.com/llvm/llvm-project/blob/main/libcxx/src/chrono.cpp
Change-Id: Ieec322d73c1e40ad95c8fffd174641c723b81be2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Diffstat (limited to 'src/corelib/kernel/qdeadlinetimer.cpp')
-rw-r--r-- | src/corelib/kernel/qdeadlinetimer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/kernel/qdeadlinetimer.cpp b/src/corelib/kernel/qdeadlinetimer.cpp index a5d16ddf65..ef78a71981 100644 --- a/src/corelib/kernel/qdeadlinetimer.cpp +++ b/src/corelib/kernel/qdeadlinetimer.cpp @@ -107,7 +107,7 @@ bool TimeReference::sign(qint64 secs, qint64 nsecs) return nsecs > 0; } -#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN) +#if defined(Q_OS_UNIX) inline bool TimeReference::addNanoseconds(qint64 arg) { return addSecsAndNSecs(arg / giga, arg % giga); |