mirror of
https://github.com/holub/mame
synced 2025-10-04 08:28:39 +03:00
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.
This commit is contained in:
parent
8fb0ab46bb
commit
f2ad7351ef
8
3rdparty/bx/include/bx/thread.h
vendored
8
3rdparty/bx/include/bx/thread.h
vendored
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user