mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
SAPI: Mark all Lua API functions requiring envlock
This commit is contained in:
parent
3936a5e3f7
commit
54f1267c2c
13 changed files with 141 additions and 37 deletions
|
@ -33,6 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#define API_FCT(name) registerFunction(L, #name, l_##name,top)
|
||||
#define ASYNC_API_FCT(name) engine.registerFunction(#name, l_##name)
|
||||
|
||||
#define MAP_LOCK_REQUIRED
|
||||
#define NO_MAP_LOCK_REQUIRED
|
||||
|
||||
/*
|
||||
|
@ -45,4 +46,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#endif
|
||||
*/
|
||||
|
||||
#define GET_ENV_PTR_NO_MAP_LOCK \
|
||||
ServerEnvironment *env = (ServerEnvironment *)getEnv(L); \
|
||||
if (env == NULL) \
|
||||
return 0
|
||||
|
||||
#define GET_ENV_PTR \
|
||||
MAP_LOCK_REQUIRED; \
|
||||
GET_ENV_PTR_NO_MAP_LOCK
|
||||
|
||||
#endif /* L_INTERNAL_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue