From 55d22ef3bc5f512a9dadd84fd85895824dad73d9 Mon Sep 17 00:00:00 2001 From: Datong Sun Date: Mon, 3 Apr 2017 21:22:19 -0700 Subject: bugfix: conditionally build luaL_setfuncs() function as the latest LuaJIT v2.1 already includes it. fixes #21. --- lua_cjson.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua_cjson.c b/lua_cjson.c index 89cba6d..cd17d7a 100644 --- a/lua_cjson.c +++ b/lua_cjson.c @@ -1342,8 +1342,9 @@ static int json_decode(lua_State *l) /* ===== INITIALISATION ===== */ -#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 -/* Compatibility for Lua 5.1. +#if !defined(luaL_newlibtable) \ + && (!defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502) +/* Compatibility for Lua 5.1 and older LuaJIT. * * luaL_setfuncs() is used to create a module table where the functions have * json_config_t as their first upvalue. Code borrowed from Lua 5.2 source. */ -- cgit v1.2.3-55-g6feb