about summary refs log tree commit diff
path: root/misc/sys/cdefs.h
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/cdefs.h
parent2fd6ff133bc7df197ff3c00f50b3f9a485095b9c (diff)
downloadglibc-4af3879c26dd1c91d68d87189587bcc8ecd3dcfc.tar.gz
glibc-4af3879c26dd1c91d68d87189587bcc8ecd3dcfc.tar.xz
glibc-4af3879c26dd1c91d68d87189587bcc8ecd3dcfc.zip
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/cdefs.h')
-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 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 <bits/wordsize.h>
 
 #if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH