aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim@codesourcery.com>2010-05-27 12:08:51 +0000
committerMaxim Kuvyrkov <mkuvyrkov@gcc.gnu.org>2010-05-27 12:08:51 +0000
commit3714764d104151e6b3658ead1559cec3ee9266a6 (patch)
tree1d58884152065faaffe543e6cd938b9edcfa6e2a
parent51b9db927f5dca75792b11cbc91266d6b842a6b2 (diff)
downloadgcc-3714764d104151e6b3658ead1559cec3ee9266a6.zip
gcc-3714764d104151e6b3658ead1559cec3ee9266a6.tar.gz
gcc-3714764d104151e6b3658ead1559cec3ee9266a6.tar.bz2
gthr-posix.h (pthread_cancel): Don't declare if compiling against Bionic C library.
* gthr-posix.h (pthread_cancel): Don't declare if compiling against Bionic C library. (__gthread_active_p): Check for pthread_create if compiling against Bionic C library. From-SVN: r159919
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/gthr-posix.h12
2 files changed, 18 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 68fffda..6d8c2e8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2010-05-27 Maxim Kuvyrkov <maxim@codesourcery.com>
+ * gthr-posix.h (pthread_cancel): Don't declare if compiling against
+ Bionic C library.
+ (__gthread_active_p): Check for pthread_create if compiling against
+ Bionic C library.
+
+2010-05-27 Maxim Kuvyrkov <maxim@codesourcery.com>
+
Support compilation for Android platform. Reimplement -mandroid.
* config.gcc (*linux*): Include linux-android.h and linux-android.opt.
diff --git a/gcc/gthr-posix.h b/gcc/gthr-posix.h
index 61b4dda..a7ce311 100644
--- a/gcc/gthr-posix.h
+++ b/gcc/gthr-posix.h
@@ -124,7 +124,9 @@ __gthrw(pthread_join)
__gthrw(pthread_equal)
__gthrw(pthread_self)
__gthrw(pthread_detach)
+#ifndef __BIONIC__
__gthrw(pthread_cancel)
+#endif
__gthrw(sched_yield)
__gthrw(pthread_mutex_lock)
@@ -238,7 +240,15 @@ static inline int
__gthread_active_p (void)
{
static void *const __gthread_active_ptr
- = __extension__ (void *) &__gthrw_(pthread_cancel);
+ = __extension__ (void *) &__gthrw_(
+/* Android's C library does not provide pthread_cancel, check for
+ `pthread_create' instead. */
+#ifndef __BIONIC__
+ pthread_cancel
+#else
+ pthread_create
+#endif
+ );
return __gthread_active_ptr != 0;
}