summaryrefslogtreecommitdiff
path: root/multimedia/gmmlib
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2019-07-10 01:16:24 +0000
committerJan Beich <jbeich@FreeBSD.org>2019-07-10 01:16:24 +0000
commit8fd0fb2b98ff00af86fd3ddb028fff4d1b0c5003 (patch)
treeda359d15146e7d177ee74a98e5f4cf92eb39a58c /multimedia/gmmlib
parentmultimedia/libva: drop -lpthread on FreeBSD 11.4/12.1/13.0 (diff)
Add more gettid() aliases to my ports
https://man.openbsd.org/getthrid.2 https://illumos.org/man/3C/thr_self
Notes
Notes: svn path=/head/; revision=506330
Diffstat (limited to 'multimedia/gmmlib')
-rw-r--r--multimedia/gmmlib/files/patch-thread-id11
1 files changed, 9 insertions, 2 deletions
diff --git a/multimedia/gmmlib/files/patch-thread-id b/multimedia/gmmlib/files/patch-thread-id
index bf667612c763..293667fcb4bf 100644
--- a/multimedia/gmmlib/files/patch-thread-id
+++ b/multimedia/gmmlib/files/patch-thread-id
@@ -2,7 +2,7 @@ Add more BSDs and update to modern way to get thread ID
--- Source/GmmLib/Utility/GmmLog/spdlog/details/os.h.orig 2018-09-28 18:59:39 UTC
+++ Source/GmmLib/Utility/GmmLog/spdlog/details/os.h
-@@ -39,9 +39,13 @@
+@@ -39,9 +39,16 @@
#include <unistd.h>
#include <chrono>
@@ -15,10 +15,13 @@ Add more BSDs and update to modern way to get thread ID
+#elif defined(__NetBSD__)
+#include <lwp.h> // for _lwp_self
+
++#elif defined(__sun)
++#include <thread.h> // for thr_self
++
#else
#include <thread>
-@@ -302,10 +308,10 @@ inline size_t thread_id()
+@@ -302,10 +308,14 @@ inline size_t thread_id()
# define SYS_gettid __NR_gettid
# endif
return static_cast<size_t>(syscall(SYS_gettid));
@@ -30,6 +33,10 @@ Add more BSDs and update to modern way to get thread ID
+ return static_cast<size_t>(pthread_getthreadid_np());
+#elif defined(__NetBSD__)
+ return static_cast<size_t>(_lwp_self());
++#elif defined(__OpenBSD__)
++ return getthrid();
++#elif defined(__sun)
++ return thr_self();
#else //Default to standard C++11 (OSX and other Unix)
return static_cast<size_t>(std::hash<std::thread::id>()(std::this_thread::get_id()));
#endif