Commit ec95ee9e authored by Stefan Behnel's avatar Stefan Behnel

do not use __builtin_expect with GCC < 2.96

parent 36174f39
...@@ -2647,8 +2647,15 @@ if Options.gcc_branch_hints: ...@@ -2647,8 +2647,15 @@ if Options.gcc_branch_hints:
branch_prediction_macros = \ branch_prediction_macros = \
""" """
#ifdef __GNUC__ #ifdef __GNUC__
/* Test for GCC > 2.95 */
#if __GNUC__ > 2 || \
(__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
#define likely(x) __builtin_expect(!!(x), 1) #define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0) #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* __GNUC__ > 2 ... */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */ #else /* __GNUC__ */
#define likely(x) (x) #define likely(x) (x)
#define unlikely(x) (x) #define unlikely(x) (x)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment