From 8bb4b831c47369d33b1eeeb2810b2f7816283f26 Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Thu, 10 Sep 2015 21:01:55 +0300 Subject: [PATCH] Fix Android build --- include/spdlog/details/os.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/spdlog/details/os.h b/include/spdlog/details/os.h index 5748033b..1d895420 100644 --- a/include/spdlog/details/os.h +++ b/include/spdlog/details/os.h @@ -183,6 +183,9 @@ inline size_t thread_id() #ifdef _WIN32 return static_cast(::GetCurrentThreadId()); #elif __linux__ +# if defined(__ANDROID__) && defined(__ANDROID_API__) && (__ANDROID_API__ < 21) +# define SYS_gettid __NR_gettid +# endif return static_cast(syscall(SYS_gettid)); #else //Default to standard C++11 (OSX and other Unix) return static_cast(std::hash()(std::this_thread::get_id()));