projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
36174f3
)
do not use __builtin_expect with GCC < 2.96
author
Stefan Behnel
<scoder@users.berlios.de>
Mon, 3 Sep 2007 14:17:12 +0000
(16:17 +0200)
committer
Stefan Behnel
<scoder@users.berlios.de>
Mon, 3 Sep 2007 14:17:12 +0000
(16:17 +0200)
Cython/Compiler/Nodes.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/Nodes.py
b/Cython/Compiler/Nodes.py
index c447968a78733db3c94f8fa97da1c53a7a76d469..df61a8eb9b0740fee5327ef6fd47415316d7d570 100644
(file)
--- a/
Cython/Compiler/Nodes.py
+++ b/
Cython/Compiler/Nodes.py
@@
-2647,8
+2647,15
@@
if Options.gcc_branch_hints:
branch_prediction_macros = \
"""
#ifdef __GNUC__
+/* Test for GCC > 2.95 */
+#if __GNUC__ > 2 || \
+ (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* __GNUC__ > 2 ... */
+#define likely(x) (x)
+#define unlikely(x) (x)
+#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
#define likely(x) (x)
#define unlikely(x) (x)