Commit ff7d314a authored by Matthias Clasen's avatar Matthias Clasen
Browse files

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.
parent e117d676
......@@ -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
......
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