util/u_thread: don't restrict u_thread_get_time_nano() to __linux__
authorJonathan Gray <jsg@jsg.id.au>
Sat, 30 Nov 2019 15:17:36 +0000 (02:17 +1100)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 2 Dec 2019 22:23:49 +0000 (17:23 -0500)
pthread_getcpuclockid() and clock_gettime() are also available on at least
OpenBSD, FreeBSD, NetBSD, DragonFly, Cygwin.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/util/u_thread.h

index 6fc923c10e6f33af33fe5fdb95f405e1b7697867..461d30bdd121eb96593b59fcbdc42ae1580a11f5 100644 (file)
@@ -149,7 +149,7 @@ util_get_L3_for_pinned_thread(thrd_t thread, unsigned cores_per_L3)
 static inline int64_t
 u_thread_get_time_nano(thrd_t thread)
 {
-#if defined(__linux__) && defined(HAVE_PTHREAD)
+#if defined(HAVE_PTHREAD)
    struct timespec ts;
    clockid_t cid;