Commit 2db8c147 authored by Lars Buitinck's avatar Lars Buitinck

simplify test for GCC >= 2.95 for branch prediction

parent a9963a76
...@@ -8212,16 +8212,12 @@ class CnameDecoratorNode(StatNode): ...@@ -8212,16 +8212,12 @@ class CnameDecoratorNode(StatNode):
if Options.gcc_branch_hints: if Options.gcc_branch_hints:
branch_prediction_macros = """ branch_prediction_macros = """
#ifdef __GNUC__ /* Test for GCC > 2.95 */
/* Test for GCC > 2.95 */ #if defined(__GNUC__) \
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) && (__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 ... */ #else /* !__GNUC__ or GCC < 2.95 */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
#define likely(x) (x) #define likely(x) (x)
#define unlikely(x) (x) #define unlikely(x) (x)
#endif /* __GNUC__ */ #endif /* __GNUC__ */
......
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