Mesa (4088-timespec_get-used-unconditionally-build-fails-when-targeting-macos-10-14-or-earlier): Fall back on clock_gettime when timespec_get() is unavailable

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 13 05:46:31 UTC 2021


Module: Mesa
Branch: 4088-timespec_get-used-unconditionally-build-fails-when-targeting-macos-10-14-or-earlier
Commit: 26c55288a013a7e171d8366808d94967f632b5a0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=26c55288a013a7e171d8366808d94967f632b5a0

Author: Jeremy Huddleston Sequoia <jeremyhu at apple.com>
Date:   Tue Jan 12 16:44:34 2021 -0800

Fall back on clock_gettime when timespec_get() is unavailable

https://gitlab.freedesktop.org/mesa/mesa/-/issues/4088

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

---

 src/util/u_queue.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/util/u_queue.c b/src/util/u_queue.c
index 6161260634e..cae4cc316d2 100644
--- a/src/util/u_queue.c
+++ b/src/util/u_queue.c
@@ -183,7 +183,11 @@ _util_queue_fence_wait_timeout(struct util_queue_fence *fence,
    if (rel > 0) {
       struct timespec ts;
 
+#ifdef HAVE_TIMESPEC_GET
       timespec_get(&ts, TIME_UTC);
+#else
+      clock_gettime(CLOCK_REALTIME, &ts);
+#endif
 
       ts.tv_sec += abs_timeout / (1000*1000*1000);
       ts.tv_nsec += abs_timeout % (1000*1000*1000);



More information about the mesa-commit mailing list