From 22e6182dd97cf72ae009c87531e8378f3289ebd5 Mon Sep 17 00:00:00 2001 From: Francois Perrad Date: Mon, 20 Mar 2017 12:35:35 +0100 Subject: [PATCH] remove compatibility with old ref system see https://github.com/lua/lua/commit/50334faad6349046c207d3d2b130b3c67339011c --- src/lauxlib.h | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/lauxlib.h b/src/lauxlib.h index 8a60ddd3..d229fb2b 100644 --- a/src/lauxlib.h +++ b/src/lauxlib.h @@ -54,6 +54,10 @@ LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...); LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def, const char *const lst[]); +/* predefined references */ +#define LUA_NOREF (-2) +#define LUA_REFNIL (-1) + LUALIB_API int (luaL_ref) (lua_State *L, int t); LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref); @@ -143,21 +147,4 @@ LUALIB_API void (luaL_pushresult) (luaL_Buffer *B); /* }====================================================== */ - -/* compatibility with ref system */ - -/* pre-defined references */ -#define LUA_NOREF (-2) -#define LUA_REFNIL (-1) - -#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \ - (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0)) - -#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref)) - -#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref)) - - -#define luaL_reg luaL_Reg - #endif