mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
Fix Wundef in os-inl.h
This commit is contained in:
parent
da1d98d603
commit
c4df94a1d9
@ -50,7 +50,7 @@
|
|||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
#include <sys/syscall.h> //Use gettid() syscall under linux to get thread id
|
#include <sys/syscall.h> //Use gettid() syscall under linux to get thread id
|
||||||
|
|
||||||
#elif __FreeBSD__
|
#elif defined(__FreeBSD__)
|
||||||
#include <sys/thr.h> //Use thr_self() syscall under FreeBSD to get thread id
|
#include <sys/thr.h> //Use thr_self() syscall under FreeBSD to get thread id
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -306,12 +306,12 @@ SPDLOG_INLINE size_t _thread_id() SPDLOG_NOEXCEPT
|
|||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
return static_cast<size_t>(::GetCurrentThreadId());
|
return static_cast<size_t>(::GetCurrentThreadId());
|
||||||
#elif __linux__
|
#elif defined(__linux__)
|
||||||
#if defined(__ANDROID__) && defined(__ANDROID_API__) && (__ANDROID_API__ < 21)
|
#if defined(__ANDROID__) && defined(__ANDROID_API__) && (__ANDROID_API__ < 21)
|
||||||
#define SYS_gettid __NR_gettid
|
#define SYS_gettid __NR_gettid
|
||||||
#endif
|
#endif
|
||||||
return static_cast<size_t>(syscall(SYS_gettid));
|
return static_cast<size_t>(syscall(SYS_gettid));
|
||||||
#elif __FreeBSD__
|
#elif defined(__FreeBSD__)
|
||||||
long tid;
|
long tid;
|
||||||
thr_self(&tid);
|
thr_self(&tid);
|
||||||
return static_cast<size_t>(tid);
|
return static_cast<size_t>(tid);
|
||||||
|
Loading…
Reference in New Issue
Block a user