From 6c1af759b694a9119323024d188f7e430b1f9334 Mon Sep 17 00:00:00 2001 From: mkuvyrkov Date: Thu, 27 May 2010 12:08:51 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159919 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/gthr-posix.h | 12 +++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 68fffda8e970..6d8c2e8df302 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2010-05-27 Maxim Kuvyrkov + + * 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 Support compilation for Android platform. Reimplement -mandroid. diff --git a/gcc/gthr-posix.h b/gcc/gthr-posix.h index 61b4dda4271a..a7ce31118020 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; } -- 2.47.2