summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bx
diff options
context:
space:
mode:
author Steven Chamberlain <steven@pyro.eu.org>2016-07-13 12:38:20 +0100
committer Steven Chamberlain <steven@pyro.eu.org>2016-07-13 13:31:03 +0100
commitf2ad7351efa763aa545533bda773193910ba8159 (patch)
tree0e6b87799e3238483b100e3315447559c11b191a /3rdparty/bx
parent8fb0ab46bbdfc12e7b85f05c00dc171fd564d204 (diff)
bx: support glibc-based BSD platforms
On GNU/kFreeBSD, pthread_setname_np can be found in glibc's pthread.h (same as on GNU/Linux). pthread_np.h does not exist there.
Diffstat (limited to '3rdparty/bx')
-rw-r--r--3rdparty/bx/include/bx/thread.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/3rdparty/bx/include/bx/thread.h b/3rdparty/bx/include/bx/thread.h
index add66ab3514..9e105db1422 100644
--- a/3rdparty/bx/include/bx/thread.h
+++ b/3rdparty/bx/include/bx/thread.h
@@ -8,7 +8,7 @@
#if BX_PLATFORM_POSIX
# include <pthread.h>
-# if BX_PLATFORM_BSD
+# if defined(BX_PLATFORM_BSD) && !defined(__GLIBC__)
# include <pthread_np.h>
# endif
# if defined(__GLIBC__) && !( (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 12) ) )
@@ -157,12 +157,10 @@ namespace bx
{
#if BX_PLATFORM_OSX || BX_PLATFORM_IOS
pthread_setname_np(_name);
-#elif BX_PLATFORM_LINUX
-# if defined(__GLIBC__) && (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 12) )
+#elif defined(__GLIBC__) && (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 12) )
pthread_setname_np(m_handle, _name);
-# else
+#elif BX_PLATFORM_LINUX
prctl(PR_SET_NAME,_name, 0, 0, 0);
-# endif // defined(__GLIBC__) ...
#elif BX_PLATFORM_BSD
#ifdef __NetBSD__
pthread_setname_np(m_handle, "%s", (void *)_name);