Added conditional compilation so it works for Lua 5.1, 5.2, 5.3
This commit is contained in:
parent
9db58c6b8a
commit
5074828c3d
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
|||||||
# makefile for immutable table library for Lua
|
# makefile for immutable table library for Lua
|
||||||
|
|
||||||
# change these to reflect your Lua installation
|
# 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
|
LUAINC= $(LUA)/src
|
||||||
LUALIB= $(LUA)/src
|
LUALIB= $(LUA)/src
|
||||||
LUABIN= $(LUA)/src
|
LUABIN= $(LUA)/src
|
||||||
|
@ -13,6 +13,14 @@
|
|||||||
#define MYNAME "immutable"
|
#define MYNAME "immutable"
|
||||||
#define MYTYPE MYNAME
|
#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(...)
|
// Class:new(...)
|
||||||
static int Lcreate_instance(lua_State *L)
|
static int Lcreate_instance(lua_State *L)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user