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. --- misc/sys/cdefs.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'misc/sys') diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index f4e96dbe6a..b94147efe8 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -369,6 +369,12 @@ # endif #endif +#if __GNUC__ >= 3 +# define __glibc_unlikely(cond) __builtin_expect((cond), 0) +#else +# define __glibc_unlikely(cond) (cond) +#endif + #include #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH -- cgit v1.2.3-70-g09d2