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:
Matthias Clasen 2020-08-25 18:12:07 -04:00
parent e117d6768c
commit ff7d314ab5
1 changed files with 2 additions and 2 deletions

View File

@ -61,8 +61,8 @@
#define FC_LIKELY(expr) (expr)
#define FC_UNLIKELY(expr) (expr)
#else
#define FC_LIKELY(expr) (__builtin_expect (expr, 1))
#define FC_UNLIKELY(expr) (__builtin_expect (expr, 0))
#define FC_LIKELY(expr) (__builtin_expect (((expr) ? 1 : 0), 1))
#define FC_UNLIKELY(expr) (__builtin_expect (((expr) ? 1 : 0), 0))
#endif
#ifdef _WIN32