From e31d79e8da99456247df84c2f99ba9083d46efe1 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Wed, 16 Oct 2019 12:37:07 -0400 Subject: Fix build errors with newer glibc versions --- tools/profiler/tasktracer/GeckoTaskTracer.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'tools/profiler') diff --git a/tools/profiler/tasktracer/GeckoTaskTracer.cpp b/tools/profiler/tasktracer/GeckoTaskTracer.cpp index ada695614..36d1bffc3 100644 --- a/tools/profiler/tasktracer/GeckoTaskTracer.cpp +++ b/tools/profiler/tasktracer/GeckoTaskTracer.cpp @@ -20,22 +20,16 @@ #include -// We need a definition of gettid(), but glibc doesn't provide a +// We need a definition of gettid(), but older glibc versions don't provide a // wrapper for it. #if defined(__GLIBC__) #include #include -static inline pid_t gettid() -{ - return (pid_t) syscall(SYS_gettid); -} +#define gettid() static_cast(syscall(SYS_gettid)) #elif defined(XP_MACOSX) #include #include -static inline pid_t gettid() -{ - return (pid_t) syscall(SYS_thread_selfid); -} +#define gettid() static_cast(syscall(SYS_thread_selfid)) #elif defined(LINUX) #include pid_t gettid(); -- cgit v1.2.3