From 65acf35dcfa3784de7e522926469083068599550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Mon, 29 Feb 2016 18:23:24 +0100 Subject: [core] fix various compilation issues --- src/mbgl/util/thread.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mbgl/util/thread.hpp b/src/mbgl/util/thread.hpp index 33ca5aba6b..dc388c922c 100644 --- a/src/mbgl/util/thread.hpp +++ b/src/mbgl/util/thread.hpp @@ -11,6 +11,8 @@ #include #include +#include + namespace mbgl { namespace util { @@ -93,11 +95,13 @@ Thread::Thread(const ThreadContext& context, Args&&... args) { std::tuple params = std::forward_as_tuple(::std::forward(args)...); thread = std::thread([&] { - #if defined( __APPLE__) +#if defined(__APPLE__) pthread_setname_np(context.name.c_str()); - #elif defined(__linux__) +#elif defined(__GLIBC__) && defined(__GLIBC_PREREQ) +#if __GLIBC_PREREQ(2, 12) pthread_setname_np(pthread_self(), context.name.c_str()); - #endif +#endif +#endif if (context.priority == ThreadPriority::Low) { platform::makeThreadLowPriority(); -- cgit v1.2.1