From eadd8c7178c79c814ecca9652973a9b9dd4cc71b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 12 Mar 2021 15:03:33 -0300 Subject: Added option LUA_NOBUILTIN This option allows external code to avoid the use of gcc builtin macro '__builtin_expect' in the Lua API. --- luaconf.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'luaconf.h') diff --git a/luaconf.h b/luaconf.h index 38e14eda..e64d2ee3 100644 --- a/luaconf.h +++ b/luaconf.h @@ -663,11 +663,13 @@ /* ** macros to improve jump prediction, used mostly for error handling -** and debug facilities. +** and debug facilities. (Some macros in the Lua API use these macros. +** Define LUA_NOBUILTIN if you do not want '__builtin_expect' in your +** code.) */ #if !defined(luai_likely) -#if defined(__GNUC__) +#if defined(__GNUC__) && !defined(LUA_NOBUILTIN) #define luai_likely(x) (__builtin_expect(((x) != 0), 1)) #define luai_unlikely(x) (__builtin_expect(((x) != 0), 0)) #else -- cgit v1.2.3-55-g6feb