Add FC_LIKELY and FC_UNLIKELY macros

These wrap __builtin_expect where it exists.
This commit is contained in:
Matthias Clasen 2020-08-24 07:59:18 -04:00
parent 835f9bbdbe
commit 76699a4813
1 changed files with 8 additions and 0 deletions

View File

@ -57,6 +57,14 @@
#define FC_CONFIG_PATH "fonts.conf"
#endif
#ifdef _WIN32
#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))
#endif
#ifdef _WIN32
# include "fcwindows.h"
typedef UINT (WINAPI *pfnGetSystemWindowsDirectory)(LPSTR, UINT);