Fix build issue with Yocto 3.1
Signed-off-by: Blance Tang <guofeng.tang@amlogic.com>
Change-Id: Icf7ed95cf9f1dc5da49fb5acc75268d1a975e15d
diff --git a/include/cutils/threads.h b/include/cutils/threads.h
index 5727494..dc1415a 100644
--- a/include/cutils/threads.h
+++ b/include/cutils/threads.h
@@ -37,7 +37,9 @@
/***********************************************************************/
/***********************************************************************/
-extern pid_t gettid();
+#if !defined(__GLIBC__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 30)
+ extern pid_t gettid();
+#endif
#if !defined(_WIN32)
diff --git a/src/cutils/threads.cpp b/src/cutils/threads.cpp
index a7e6b2d..d3c9af4 100644
--- a/src/cutils/threads.cpp
+++ b/src/cutils/threads.cpp
@@ -32,7 +32,7 @@
#endif
// No definition needed for Android because we'll just pick up bionic's copy.
-#ifndef __ANDROID__
+#if !defined(__ANDROID__) || !defined(__GLIBC__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 30)
pid_t gettid() {
#if defined(__APPLE__)
uint64_t tid;