fixed compilation error in clang before version 8 (does not support thread_local keyword)

This commit is contained in:
PM_Extra 2016-12-03 01:40:52 +08:00
parent 33494049a8
commit f7574eb4c7
1 changed files with 1 additions and 1 deletions

View File

@ -315,7 +315,7 @@ inline size_t _thread_id()
//Return current thread id as size_t (from thread local storage)
inline size_t thread_id()
{
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#if defined(_MSC_VER) && (_MSC_VER < 1900) || defined(__clang_major__) && (__clang_major__ < 8)
return _thread_id();
#else
static thread_local const size_t tid = _thread_id();