diff options
| -rw-r--r-- | llimits.h | 14 |
1 files changed, 12 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: llimits.h,v 1.125 2014/12/19 13:30:23 roberto Exp roberto $ | 2 | ** $Id: llimits.h,v 1.126 2015/01/13 15:49:11 roberto Exp roberto $ |
| 3 | ** Limits, basic types, and some other 'installation-dependent' definitions | 3 | ** Limits, basic types, and some other 'installation-dependent' definitions |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -99,11 +99,13 @@ typedef LUAI_UACINT l_uacInt; | |||
| 99 | #define api_check(e,msg) luai_apicheck((e) && msg) | 99 | #define api_check(e,msg) luai_apicheck((e) && msg) |
| 100 | 100 | ||
| 101 | 101 | ||
| 102 | /* macro to avoid warnings about unused variables */ | ||
| 102 | #if !defined(UNUSED) | 103 | #if !defined(UNUSED) |
| 103 | #define UNUSED(x) ((void)(x)) /* to avoid warnings */ | 104 | #define UNUSED(x) ((void)(x)) |
| 104 | #endif | 105 | #endif |
| 105 | 106 | ||
| 106 | 107 | ||
| 108 | /* type casts (a macro highlights casts in the code) */ | ||
| 107 | #define cast(t, exp) ((t)(exp)) | 109 | #define cast(t, exp) ((t)(exp)) |
| 108 | 110 | ||
| 109 | #define cast_void(i) cast(void, (i)) | 111 | #define cast_void(i) cast(void, (i)) |
| @@ -176,11 +178,19 @@ typedef unsigned long Instruction; | |||
| 176 | #endif | 178 | #endif |
| 177 | 179 | ||
| 178 | 180 | ||
| 181 | /* | ||
| 182 | ** macros that are executed whenether program enters the Lua core | ||
| 183 | ** ('lua_lock') and leaves the core ('lua_unlock') | ||
| 184 | */ | ||
| 179 | #if !defined(lua_lock) | 185 | #if !defined(lua_lock) |
| 180 | #define lua_lock(L) ((void) 0) | 186 | #define lua_lock(L) ((void) 0) |
| 181 | #define lua_unlock(L) ((void) 0) | 187 | #define lua_unlock(L) ((void) 0) |
| 182 | #endif | 188 | #endif |
| 183 | 189 | ||
| 190 | /* | ||
| 191 | ** macro executed during Lua functions at points where the | ||
| 192 | ** function can yield. | ||
| 193 | */ | ||
| 184 | #if !defined(luai_threadyield) | 194 | #if !defined(luai_threadyield) |
| 185 | #define luai_threadyield(L) {lua_unlock(L); lua_lock(L);} | 195 | #define luai_threadyield(L) {lua_unlock(L); lua_lock(L);} |
| 186 | #endif | 196 | #endif |
