aboutsummaryrefslogtreecommitdiff
path: root/misc/sys
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2012-06-04 11:41:24 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2012-06-04 11:53:57 +0530
commit4af3879c26dd1c91d68d87189587bcc8ecd3dcfc (patch)
treeab8cf6b2af267b9da893166764a19854874d1437 /misc/sys
parent2fd6ff133bc7df197ff3c00f50b3f9a485095b9c (diff)
downloadglibc-4af3879c26dd1c91d68d87189587bcc8ecd3dcfc.zip
glibc-4af3879c26dd1c91d68d87189587bcc8ecd3dcfc.tar.gz
glibc-4af3879c26dd1c91d68d87189587bcc8ecd3dcfc.tar.bz2
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.
Diffstat (limited to 'misc/sys')
-rw-r--r--misc/sys/cdefs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index f4e96db..b94147e 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 <bits/wordsize.h>
#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH