Merge "threads.h: avoid defining gettid on glibc >= 2.32"

This commit is contained in:
Jim Pollock 2021-03-05 15:16:18 +00:00 committed by Gerrit Code Review
commit fdac598f63
2 changed files with 4 additions and 1 deletions

View file

@ -31,7 +31,9 @@ extern "C" {
// //
// Deprecated: use android::base::GetThreadId instead, which doesn't truncate on Mac/Windows. // Deprecated: use android::base::GetThreadId instead, which doesn't truncate on Mac/Windows.
// //
#if !defined(__GLIBC__) || __GLIBC__ >= 2 && __GLIBC_MINOR__ < 32
extern pid_t gettid(); extern pid_t gettid();
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -25,8 +25,9 @@
#include <windows.h> #include <windows.h>
#endif #endif
#if defined(__BIONIC__) #if defined(__BIONIC__) || defined(__GLIBC__) && __GLIBC_MINOR__ >= 32
// No definition needed for Android because we'll just pick up bionic's copy. // No definition needed for Android because we'll just pick up bionic's copy.
// No definition needed for Glibc >= 2.32 because it exposes its own copy.
#else #else
pid_t gettid() { pid_t gettid() {
#if defined(__APPLE__) #if defined(__APPLE__)