diff options
Diffstat (limited to 'luaconf.h')
-rw-r--r-- | luaconf.h | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -660,6 +660,26 @@ | |||
660 | #define lua_getlocaledecpoint() (localeconv()->decimal_point[0]) | 660 | #define lua_getlocaledecpoint() (localeconv()->decimal_point[0]) |
661 | #endif | 661 | #endif |
662 | 662 | ||
663 | |||
664 | /* | ||
665 | ** macros to improve jump prediction, used mostly for error handling | ||
666 | ** and debug facilities. | ||
667 | */ | ||
668 | #if (defined(LUA_CORE) || defined(LUA_LIB)) && !defined(l_likely) | ||
669 | |||
670 | #include <stdio.h> | ||
671 | #if defined(__GNUC__) | ||
672 | #define l_likely(x) (__builtin_expect(((x) != 0), 1)) | ||
673 | #define l_unlikely(x) (__builtin_expect(((x) != 0), 0)) | ||
674 | #else | ||
675 | #define l_likely(x) (x) | ||
676 | #define l_unlikely(x) (x) | ||
677 | #endif | ||
678 | |||
679 | #endif | ||
680 | |||
681 | |||
682 | |||
663 | /* }================================================================== */ | 683 | /* }================================================================== */ |
664 | 684 | ||
665 | 685 | ||