From 21a071661320806bd521f4d5e6259601627fd531 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Tue, 25 Jul 2023 12:57:45 -0700 Subject: [PATCH] Remove gettid declaration from cutils Bug: 289414897 Test: it builds Change-Id: I22d93406cf065c0e3c7d94e800763974d228ee21 --- libcutils/include/cutils/threads.h | 15 --------------- libcutils/threads.cpp | 6 ++++-- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/libcutils/include/cutils/threads.h b/libcutils/include/cutils/threads.h index 18861840e..92564b8db 100644 --- a/libcutils/include/cutils/threads.h +++ b/libcutils/include/cutils/threads.h @@ -23,18 +23,3 @@ #else #include #endif - -#ifdef __cplusplus -extern "C" { -#endif - -// -// Deprecated: use android::base::GetThreadId instead, which doesn't truncate on Mac/Windows. -// -#if !defined(__GLIBC__) || __GLIBC__ >= 2 && __GLIBC_MINOR__ < 30 -extern pid_t gettid(); -#endif - -#ifdef __cplusplus -} -#endif diff --git a/libcutils/threads.cpp b/libcutils/threads.cpp index 263872084..cca50c191 100644 --- a/libcutils/threads.cpp +++ b/libcutils/threads.cpp @@ -14,11 +14,13 @@ ** limitations under the License. */ -#include +#include #if defined(__APPLE__) +#include #include #elif defined(__linux__) +#include #include #include #elif defined(_WIN32) @@ -29,7 +31,7 @@ // No definition needed for Android because we'll just pick up bionic's copy. // No definition needed for Glibc >= 2.30 because it exposes its own copy. #else -pid_t gettid() { +extern "C" pid_t gettid() { #if defined(__APPLE__) uint64_t tid; pthread_threadid_np(NULL, &tid);