diff --git a/deps/v8/src/base/platform/platform-posix.cc b/deps/v8/src/base/platform/platform-posix.cc index 252d21375529..771634e24e95 100644 --- a/deps/v8/src/base/platform/platform-posix.cc +++ b/deps/v8/src/base/platform/platform-posix.cc @@ -321,11 +321,15 @@ int OS::GetCurrentProcessId() { int OS::GetCurrentThreadId() { -#if defined(ANDROID) +#if V8_OS_MACOSX + return static_cast(pthread_mach_thread_np(pthread_self())); +#elif V8_OS_LINUX return static_cast(syscall(__NR_gettid)); +#elif V8_OS_ANDROID + return static_cast(gettid()); #else - return static_cast(syscall(SYS_gettid)); -#endif // defined(ANDROID) + return static_cast(pthread_self()); +#endif } diff --git a/deps/v8/src/base/platform/platform.h b/deps/v8/src/base/platform/platform.h index 8a5412626857..9567572d8003 100644 --- a/deps/v8/src/base/platform/platform.h +++ b/deps/v8/src/base/platform/platform.h @@ -35,6 +35,7 @@ namespace std { int signbit(double x); } # endif +#include #endif #if V8_OS_QNX