forked from Mirrorlandia_minetest/minetest
Use enum to define custom registry indices
This commit is contained in:
@ -44,19 +44,21 @@ extern "C" {
|
||||
Lua 5.1 / LuaJIT do not use any numeric indices (only string indices),
|
||||
so we can use numeric indices freely.
|
||||
*/
|
||||
enum {
|
||||
#ifdef LUA_RIDX_LAST
|
||||
#define CUSTOM_RIDX_BASE ((LUA_RIDX_LAST)+1)
|
||||
CUSTOM_RIDX_BEFORE_ = LUA_RIDX_LAST,
|
||||
#else
|
||||
#define CUSTOM_RIDX_BASE 1
|
||||
CUSTOM_RIDX_BEFORE_ = 0,
|
||||
#endif
|
||||
|
||||
#define CUSTOM_RIDX_SCRIPTAPI (CUSTOM_RIDX_BASE)
|
||||
#define CUSTOM_RIDX_GLOBALS_BACKUP (CUSTOM_RIDX_BASE + 1)
|
||||
#define CUSTOM_RIDX_CURRENT_MOD_NAME (CUSTOM_RIDX_BASE + 2)
|
||||
#define CUSTOM_RIDX_BACKTRACE (CUSTOM_RIDX_BASE + 3)
|
||||
#define CUSTOM_RIDX_HTTP_API_LUA (CUSTOM_RIDX_BASE + 4)
|
||||
#define CUSTOM_RIDX_VECTOR_METATABLE (CUSTOM_RIDX_BASE + 5)
|
||||
#define CUSTOM_RIDX_METATABLE_MAP (CUSTOM_RIDX_BASE + 6)
|
||||
CUSTOM_RIDX_SCRIPTAPI,
|
||||
CUSTOM_RIDX_GLOBALS_BACKUP,
|
||||
CUSTOM_RIDX_CURRENT_MOD_NAME,
|
||||
CUSTOM_RIDX_BACKTRACE,
|
||||
CUSTOM_RIDX_HTTP_API_LUA,
|
||||
CUSTOM_RIDX_VECTOR_METATABLE,
|
||||
CUSTOM_RIDX_METATABLE_MAP,
|
||||
};
|
||||
|
||||
|
||||
// Determine if CUSTOM_RIDX_SCRIPTAPI will hold a light or full userdata
|
||||
|
Reference in New Issue
Block a user