util: Always use timespec_get on Windows.
authorJose Fonseca <jose.r.fonseca@gmail.com>
Wed, 24 Feb 2021 20:02:34 +0000 (20:02 +0000)
committerMarge Bot <eric+marge@anholt.net>
Tue, 2 Mar 2021 14:37:46 +0000 (14:37 +0000)
include/c11/threads_win32.h provides a fallback implementation of
timespec_get when necessary.

Fixes https://gitlab.freedesktop.org/mesa/mesa/-/issues/4109

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9280>

src/util/u_queue.c

index f2aaba4..19aa829 100644 (file)
@@ -183,7 +183,7 @@ _util_queue_fence_wait_timeout(struct util_queue_fence *fence,
    if (rel > 0) {
       struct timespec ts;
 
-#ifdef HAVE_TIMESPEC_GET
+#if defined(HAVE_TIMESPEC_GET) || defined(_WIN32)
       timespec_get(&ts, TIME_UTC);
 #else
       clock_gettime(CLOCK_REALTIME, &ts);