diff --git a/include/bx/thread.h b/include/bx/thread.h index fb9e07d..0abccaa 100644 --- a/include/bx/thread.h +++ b/include/bx/thread.h @@ -8,6 +8,11 @@ #if BX_PLATFORM_POSIX # include + #if defined(__GLIBC__) + #if!((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 12))) + #include + #endif + #endif #elif BX_PLATFORM_WINRT using namespace Platform; using namespace Windows::Foundation; @@ -149,7 +154,13 @@ namespace bx { #if BX_PLATFORM_OSX || BX_PLATFORM_IOS pthread_setname_np(_name); -#elif (BX_PLATFORM_LINUX && defined(__GLIBC__)) || BX_PLATFORM_BSD +#elif (BX_PLATFORM_LINUX && defined(__GLIBC__)) + #if (__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 12)) + pthread_setname_np(m_handle, _name); + #else + prctl(PR_SET_NAME,_name,0,0,0); + #endif +#elif BX_PLATFORM_BSD pthread_setname_np(m_handle, _name); #elif BX_PLATFORM_WINDOWS && BX_COMPILER_MSVC # pragma pack(push, 8)