From 7cf34ce8204e245f3ede4c5b6bcbf2d8855621eb Mon Sep 17 00:00:00 2001 From: gabime Date: Wed, 8 Apr 2015 10:55:25 +0300 Subject: [PATCH] Fixed return type in os::get_thread_id --- include/spdlog/details/os.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/spdlog/details/os.h b/include/spdlog/details/os.h index 8b073cd4..e4ad717a 100644 --- a/include/spdlog/details/os.h +++ b/include/spdlog/details/os.h @@ -171,7 +171,8 @@ inline int utc_minutes_offset(const std::tm& tm = details::os::localtime()) #endif } -//Return current thread id as 64 bit integer +//Return current thread id as size_t +//It exists because the std::this_thread::get_id() is much slower(espcially under VS 2013) inline size_t thread_id() { @@ -182,9 +183,9 @@ inline size_t thread_id() #ifdef _WIN32 return ::GetCurrentThreadId(); #elif __linux__ - return (uint64_t) syscall(SYS_gettid); + return syscall(SYS_gettid); #else - return (uint64_t) pthread_self(); + return pthread_self(); #endif #endif //SPDLOG_NO_THREAD_ID }