aboutsummaryrefslogtreecommitdiff
path: root/luaconf.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-03-12 15:03:33 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-03-12 15:03:33 -0300
commiteadd8c7178c79c814ecca9652973a9b9dd4cc71b (patch)
tree8cef51d4d7abc1997b3829cf41891b4b44e3655b /luaconf.h
parent014daf43cb3bf1ceb6af102c9294ec04abf9a6b6 (diff)
downloadlua-eadd8c7178c79c814ecca9652973a9b9dd4cc71b.tar.gz
lua-eadd8c7178c79c814ecca9652973a9b9dd4cc71b.tar.bz2
lua-eadd8c7178c79c814ecca9652973a9b9dd4cc71b.zip
Added option LUA_NOBUILTINv5.4.3
This option allows external code to avoid the use of gcc builtin macro '__builtin_expect' in the Lua API.
Diffstat (limited to 'luaconf.h')
-rw-r--r--luaconf.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/luaconf.h b/luaconf.h
index 38e14eda..e64d2ee3 100644
--- a/luaconf.h
+++ b/luaconf.h
@@ -663,11 +663,13 @@
663 663
664/* 664/*
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. (Some macros in the Lua API use these macros.
667** Define LUA_NOBUILTIN if you do not want '__builtin_expect' in your
668** code.)
667*/ 669*/
668#if !defined(luai_likely) 670#if !defined(luai_likely)
669 671
670#if defined(__GNUC__) 672#if defined(__GNUC__) && !defined(LUA_NOBUILTIN)
671#define luai_likely(x) (__builtin_expect(((x) != 0), 1)) 673#define luai_likely(x) (__builtin_expect(((x) != 0), 1))
672#define luai_unlikely(x) (__builtin_expect(((x) != 0), 0)) 674#define luai_unlikely(x) (__builtin_expect(((x) != 0), 0))
673#else 675#else