From 55ac40f859ad8e28fe71a8801d49f4a4140e8aa3 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 20 Jun 2024 13:43:33 -0300 Subject: Cleaning of llimits.h Several definitions that don't need to be "global" (that is, that concerns only specific parts of the code) moved out of llimits.h, to more appropriate places. --- lapi.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lapi.h') diff --git a/lapi.h b/lapi.h index 757bf3d2..21be4a24 100644 --- a/lapi.h +++ b/lapi.h @@ -12,11 +12,31 @@ #include "lstate.h" +#if defined(LUA_USE_APICHECK) +#include +#define api_check(l,e,msg) assert(e) +#else /* for testing */ +#define api_check(l,e,msg) ((void)(l), lua_assert((e) && msg)) +#endif + + + /* Increments 'L->top.p', checking for stack overflows */ #define api_incr_top(L) \ (L->top.p++, api_check(L, L->top.p <= L->ci->top.p, "stack overflow")) +/* +** macros that are executed whenever program enters the Lua core +** ('lua_lock') and leaves the core ('lua_unlock') +*/ +#if !defined(lua_lock) +#define lua_lock(L) ((void) 0) +#define lua_unlock(L) ((void) 0) +#endif + + + /* ** If a call returns too many multiple returns, the callee may not have ** stack space to accommodate all results. In this case, this macro -- cgit v1.2.3-55-g6feb