Fix up FC_LIKELY macros
__builtin_expect returns the same type as the expression, so enforce that we pass in a boolean expression. Pointed out by Emmanuele Bassi.
This commit is contained in:
parent
e117d6768c
commit
ff7d314ab5
|
@ -61,8 +61,8 @@
|
||||||
#define FC_LIKELY(expr) (expr)
|
#define FC_LIKELY(expr) (expr)
|
||||||
#define FC_UNLIKELY(expr) (expr)
|
#define FC_UNLIKELY(expr) (expr)
|
||||||
#else
|
#else
|
||||||
#define FC_LIKELY(expr) (__builtin_expect (expr, 1))
|
#define FC_LIKELY(expr) (__builtin_expect (((expr) ? 1 : 0), 1))
|
||||||
#define FC_UNLIKELY(expr) (__builtin_expect (expr, 0))
|
#define FC_UNLIKELY(expr) (__builtin_expect (((expr) ? 1 : 0), 0))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
Loading…
Reference in New Issue