From c4df94a1d99823426de1154b8cd65b080d5275a0 Mon Sep 17 00:00:00 2001 From: AMS21 <19614997+AMS21@users.noreply.github.com> Date: Mon, 19 Aug 2019 20:50:46 +0000 Subject: [PATCH] Fix Wundef in os-inl.h --- include/spdlog/details/os-inl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/spdlog/details/os-inl.h b/include/spdlog/details/os-inl.h index 96b2b4fe..242405da 100644 --- a/include/spdlog/details/os-inl.h +++ b/include/spdlog/details/os-inl.h @@ -50,7 +50,7 @@ #ifdef __linux__ #include //Use gettid() syscall under linux to get thread id -#elif __FreeBSD__ +#elif defined(__FreeBSD__) #include //Use thr_self() syscall under FreeBSD to get thread id #endif @@ -306,12 +306,12 @@ SPDLOG_INLINE size_t _thread_id() SPDLOG_NOEXCEPT { #ifdef _WIN32 return static_cast(::GetCurrentThreadId()); -#elif __linux__ +#elif defined(__linux__) #if defined(__ANDROID__) && defined(__ANDROID_API__) && (__ANDROID_API__ < 21) #define SYS_gettid __NR_gettid #endif return static_cast(syscall(SYS_gettid)); -#elif __FreeBSD__ +#elif defined(__FreeBSD__) long tid; thr_self(&tid); return static_cast(tid);