From 7c9cb2971dc5c33b79749ffeccc9ccad91bb9b5b Mon Sep 17 00:00:00 2001 From: jules Date: Sun, 23 Jun 2013 12:26:58 +0100 Subject: [PATCH] Avoided using pthread_setname_np on older linux distros. --- modules/juce_core/native/juce_posix_SharedCode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h index 6d649af375..641f1d141d 100644 --- a/modules/juce_core/native/juce_posix_SharedCode.h +++ b/modules/juce_core/native/juce_posix_SharedCode.h @@ -874,7 +874,7 @@ void Thread::setCurrentThreadName (const String& name) { [[NSThread currentThread] setName: juceStringToNS (name)]; } - #elif JUCE_LINUX + #elif JUCE_LINUX && (__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2012 pthread_setname_np (pthread_self(), name.toRawUTF8()); #endif } @@ -885,7 +885,7 @@ bool Thread::setThreadPriority (void* handle, int priority) int policy; priority = jlimit (0, 10, priority); - if (handle == 0) + if (handle == nullptr) handle = (void*) pthread_self(); if (pthread_getschedparam ((pthread_t) handle, &policy, ¶m) != 0)