diff options
Diffstat (limited to 'src/lua/luaconf.h')
| -rw-r--r-- | src/lua/luaconf.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/lua/luaconf.h b/src/lua/luaconf.h index ae73e2f..38e14ed 100644 --- a/src/lua/luaconf.h +++ b/src/lua/luaconf.h | |||
| @@ -665,20 +665,26 @@ | |||
| 665 | ** macros to improve jump prediction, used mostly for error handling | 665 | ** macros to improve jump prediction, used mostly for error handling |
| 666 | ** and debug facilities. | 666 | ** and debug facilities. |
| 667 | */ | 667 | */ |
| 668 | #if (defined(LUA_CORE) || defined(LUA_LIB)) && !defined(l_likely) | 668 | #if !defined(luai_likely) |
| 669 | 669 | ||
| 670 | #include <stdio.h> | ||
| 671 | #if defined(__GNUC__) | 670 | #if defined(__GNUC__) |
| 672 | #define l_likely(x) (__builtin_expect(((x) != 0), 1)) | 671 | #define luai_likely(x) (__builtin_expect(((x) != 0), 1)) |
| 673 | #define l_unlikely(x) (__builtin_expect(((x) != 0), 0)) | 672 | #define luai_unlikely(x) (__builtin_expect(((x) != 0), 0)) |
| 674 | #else | 673 | #else |
| 675 | #define l_likely(x) (x) | 674 | #define luai_likely(x) (x) |
| 676 | #define l_unlikely(x) (x) | 675 | #define luai_unlikely(x) (x) |
| 677 | #endif | 676 | #endif |
| 678 | 677 | ||
| 679 | #endif | 678 | #endif |
| 680 | 679 | ||
| 681 | 680 | ||
| 681 | #if defined(LUA_CORE) || defined(LUA_LIB) | ||
| 682 | /* shorter names for Lua's own use */ | ||
| 683 | #define l_likely(x) luai_likely(x) | ||
| 684 | #define l_unlikely(x) luai_unlikely(x) | ||
| 685 | #endif | ||
| 686 | |||
| 687 | |||
| 682 | 688 | ||
| 683 | /* }================================================================== */ | 689 | /* }================================================================== */ |
| 684 | 690 | ||
