Merge pull request #90 from mahlemiut/master

fix building with glibc < 2.12
This commit is contained in:
Branimir Karadžić
2016-02-08 08:47:50 -08:00

View File

@@ -8,6 +8,11 @@
#if BX_PLATFORM_POSIX
# include <pthread.h>
#if defined(__GLIBC__)
#if!((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 12)))
#include <sys/prctl.h>
#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)