From 0bf428d71e1dabb9b3bc09cf5b4da1cff86f441e 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 12d440a7..e43f10cf 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