diff options
Diffstat (limited to 'lapi.h')
-rw-r--r-- | lapi.h | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -12,12 +12,32 @@ | |||
12 | #include "lstate.h" | 12 | #include "lstate.h" |
13 | 13 | ||
14 | 14 | ||
15 | #if defined(LUA_USE_APICHECK) | ||
16 | #include <assert.h> | ||
17 | #define api_check(l,e,msg) assert(e) | ||
18 | #else /* for testing */ | ||
19 | #define api_check(l,e,msg) ((void)(l), lua_assert((e) && msg)) | ||
20 | #endif | ||
21 | |||
22 | |||
23 | |||
15 | /* Increments 'L->top.p', checking for stack overflows */ | 24 | /* Increments 'L->top.p', checking for stack overflows */ |
16 | #define api_incr_top(L) \ | 25 | #define api_incr_top(L) \ |
17 | (L->top.p++, api_check(L, L->top.p <= L->ci->top.p, "stack overflow")) | 26 | (L->top.p++, api_check(L, L->top.p <= L->ci->top.p, "stack overflow")) |
18 | 27 | ||
19 | 28 | ||
20 | /* | 29 | /* |
30 | ** macros that are executed whenever program enters the Lua core | ||
31 | ** ('lua_lock') and leaves the core ('lua_unlock') | ||
32 | */ | ||
33 | #if !defined(lua_lock) | ||
34 | #define lua_lock(L) ((void) 0) | ||
35 | #define lua_unlock(L) ((void) 0) | ||
36 | #endif | ||
37 | |||
38 | |||
39 | |||
40 | /* | ||
21 | ** If a call returns too many multiple returns, the callee may not have | 41 | ** If a call returns too many multiple returns, the callee may not have |
22 | ** stack space to accommodate all results. In this case, this macro | 42 | ** stack space to accommodate all results. In this case, this macro |
23 | ** increases its stack space ('L->ci->top.p'). | 43 | ** increases its stack space ('L->ci->top.p'). |