diff --git a/Makefile b/Makefile index 82a321d..21056a4 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # makefile for immutable table library for Lua # change these to reflect your Lua installation -LUA= /users/Bruce/Sandbox/Lua/lua-5.1.5 +LUA= /users/Bruce/Sandbox/Lua/lua-5.3.4 LUAINC= $(LUA)/src LUALIB= $(LUA)/src LUABIN= $(LUA)/src diff --git a/limmutable.c b/limmutable.c index ccd0652..0d15aa6 100644 --- a/limmutable.c +++ b/limmutable.c @@ -13,6 +13,14 @@ #define MYNAME "immutable" #define MYTYPE MYNAME +// API changes from 5.1 to 5.3 +#if LUA_VERSION_NUM >= 502 +#define lua_objlen(L, i) lua_rawlen(L, i) +#define lua_equal(L, i, j) lua_compare(L, i, j, LUA_OPEQ) +#define luaH_getnum(t, k) luaH_getint(t, k) +#define luaL_register(L, _, R) luaL_setfuncs(L, R, 0) +#endif + // Class:new(...) static int Lcreate_instance(lua_State *L) {