From ec95ee9eaa5b99cfebabfe20a41043d04417d5be Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Mon, 3 Sep 2007 16:17:12 +0200 Subject: [PATCH] do not use __builtin_expect with GCC < 2.96 --- Cython/Compiler/Nodes.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index c447968a..df61a8eb 100644 --- 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) -- 2.26.2