diff --git a/port/stack_trace.cc b/port/stack_trace.cc index 5c7e4db49..51d136b04 100644 --- a/port/stack_trace.cc +++ b/port/stack_trace.cc @@ -31,14 +31,18 @@ void* SaveStack(int* /*num_frames*/, int /*first_frames_to_skip*/) { #include #include -#if defined(OS_FREEBSD) +#ifdef OS_FREEBSD #include -#endif +#endif // OS_FREEBSD #ifdef OS_LINUX #include #include #include -#endif +#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 30) +#include +#define gettid() syscall(SYS_gettid) +#endif // GLIBC version +#endif // OS_LINUX #include "port/lang.h"