diff options
Diffstat (limited to 'libs/liblua/src/llimits.h')
-rw-r--r-- | libs/liblua/src/llimits.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libs/liblua/src/llimits.h b/libs/liblua/src/llimits.h index 025f1c82cd..d03948314f 100644 --- a/libs/liblua/src/llimits.h +++ b/libs/liblua/src/llimits.h @@ -150,6 +150,22 @@ typedef LUAI_UACINT l_uacInt; /* +** macros to improve jump prediction (used mainly for error handling) +*/ +#if !defined(likely) + +#if defined(__GNUC__) +#define likely(x) (__builtin_expect(((x) != 0), 1)) +#define unlikely(x) (__builtin_expect(((x) != 0), 0)) +#else +#define likely(x) (x) +#define unlikely(x) (x) +#endif + +#endif + + +/* ** non-return type */ #if !defined(l_noret) |