Mesa (master): util/u_thread: Fix build under Haiku

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 22 16:37:40 UTC 2020


Module: Mesa
Branch: master
Commit: eb40c0adfc35018151e9ecc866526b3778444a20
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=eb40c0adfc35018151e9ecc866526b3778444a20

Author: X512 <danger_mail at list.ru>
Date:   Thu Jan  9 00:59:21 2020 +0000

util/u_thread: Fix build under Haiku

---

 src/util/u_thread.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/util/u_thread.h b/src/util/u_thread.h
index 6fc89099fec..5bb06608fc9 100644
--- a/src/util/u_thread.h
+++ b/src/util/u_thread.h
@@ -40,6 +40,10 @@
 #endif
 #endif
 
+#ifdef __HAIKU__
+#include <OS.h>
+#endif
+
 #ifdef __FreeBSD__
 #define cpu_set_t cpuset_t
 #endif
@@ -77,6 +81,8 @@ static inline void u_thread_setname( const char *name )
    pthread_setname_np(pthread_self(), "%s", (void *)name);
 #elif DETECT_OS_APPLE
    pthread_setname_np(name);
+#elif DETECT_OS_HAIKU
+   rename_thread(find_thread(NULL), name);
 #else
 #error Not sure how to call pthread_setname_np
 #endif
@@ -149,7 +155,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(HAVE_PTHREAD) && !defined(__APPLE__)
+#if defined(HAVE_PTHREAD) && !defined(__APPLE__) && !defined(__HAIKU__)
    struct timespec ts;
    clockid_t cid;
 



More information about the mesa-commit mailing list