From 4af3879c26dd1c91d68d87189587bcc8ecd3dcfc Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Mon, 4 Jun 2012 11:41:24 +0530 Subject: Wrap __builtin_expect in pthread.h [BZ #14188] This fixes compilation of programs using pthread_cleanup_push built with non-gcc compilers and older gcc compilers. --- nptl/ChangeLog | 9 +++++++++ nptl/sysdeps/pthread/pthread.h | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'nptl') diff --git a/nptl/ChangeLog b/nptl/ChangeLog index f96646784e..2bc35857f1 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,12 @@ +2012-06-04 Siddhesh Poyarekar + Jakub Jelinek + + [BZ #14188] + * sysdeps/pthread/pthread.h + [!(defined __GNUC__ && defined __EXCEPTIONS)] + (pthread_cleanup_push, pthread_cleanup_push_defer_np): Use + __libc_unlikely instead of __builtin_expect. + 2012-05-30 H.J. Lu [BZ #14117] diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h index 88c7c257ae..246c1a0cd5 100644 --- a/nptl/sysdeps/pthread/pthread.h +++ b/nptl/sysdeps/pthread/pthread.h @@ -659,7 +659,7 @@ __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame) void *__cancel_arg = (arg); \ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ __cancel_buf.__cancel_jmp_buf, 0); \ - if (__builtin_expect (__not_first_call, 0)) \ + if (__glibc_unlikely (__not_first_call)) \ { \ __cancel_routine (__cancel_arg); \ __pthread_unwind_next (&__cancel_buf); \ @@ -694,7 +694,7 @@ extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf) void *__cancel_arg = (arg); \ int __not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) (void *) \ __cancel_buf.__cancel_jmp_buf, 0); \ - if (__builtin_expect (__not_first_call, 0)) \ + if (__glibc_unlikely (__not_first_call)) \ { \ __cancel_routine (__cancel_arg); \ __pthread_unwind_next (&__cancel_buf); \ -- cgit v1.2.3