mirror of
https://github.com/minetest/minetest.git
synced 2025-03-06 20:48:40 +01:00
Use enum to define custom registry indices
This commit is contained in:
parent
f073e37d2f
commit
f7ae70c3d9
1 changed files with 11 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue