mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 01:51:38 +08:00
Fix Android build
This commit is contained in:
parent
88cfb1931b
commit
8bb4b831c4
@ -183,6 +183,9 @@ inline size_t thread_id()
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
return static_cast<size_t>(::GetCurrentThreadId());
|
return static_cast<size_t>(::GetCurrentThreadId());
|
||||||
#elif __linux__
|
#elif __linux__
|
||||||
|
# if defined(__ANDROID__) && defined(__ANDROID_API__) && (__ANDROID_API__ < 21)
|
||||||
|
# define SYS_gettid __NR_gettid
|
||||||
|
# endif
|
||||||
return static_cast<size_t>(syscall(SYS_gettid));
|
return static_cast<size_t>(syscall(SYS_gettid));
|
||||||
#else //Default to standard C++11 (OSX and other Unix)
|
#else //Default to standard C++11 (OSX and other Unix)
|
||||||
return static_cast<size_t>(std::hash<std::thread::id>()(std::this_thread::get_id()));
|
return static_cast<size_t>(std::hash<std::thread::id>()(std::this_thread::get_id()));
|
||||||
|
Loading…
Reference in New Issue
Block a user