projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a082dbd
)
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 12d440a7f3586c158014f9450a3069a3ba91094d..e43f10cf079297b96dc0f2a86c7ef9d94229990a 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)