From 433e5c7d9bb6a4e0801b7609e9bb5c040e840599 Mon Sep 17 00:00:00 2001 From: Date: Thu, 28 Apr 2016 18:27:35 -0400 Subject: [PATCH] [Common] gettid() not declared in this scope --- Source/Common/Thread.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Common/Thread.cpp b/Source/Common/Thread.cpp index 904727e7b..a58b4aa87 100644 --- a/Source/Common/Thread.cpp +++ b/Source/Common/Thread.cpp @@ -3,6 +3,7 @@ #ifndef _WIN32 #include #include +#include #endif CThread::CThread(CTHREAD_START_ROUTINE lpStartAddress) : @@ -125,6 +126,8 @@ uint32_t CThread::GetCurrentThreadId(void) { #ifdef _WIN32 return ::GetCurrentThreadId(); +#elif defined(SYS_gettid) || defined(__NR_gettid) + return syscall(__NR_gettid); /* GLIBC has no implementation of gettid(). */ #else return gettid(); #endif