aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDatong Sun <dndx@idndx.com>2017-04-03 21:22:19 -0700
committerYichun Zhang (agentzh) <yichun@openresty.com>2017-04-05 15:51:37 -0700
commit55d22ef3bc5f512a9dadd84fd85895824dad73d9 (patch)
tree0644d30b7ce2a7f07f28b809b935ea76b611f9b7
parentfd35fd98035735bc91c55d14832461e41dd0e193 (diff)
downloadlua-cjson-2.1.0.5.tar.gz
lua-cjson-2.1.0.5.tar.bz2
lua-cjson-2.1.0.5.zip
bugfix: conditionally build luaL_setfuncs() function as the latest LuaJIT v2.1 already includes it. fixes #21.2.1.0.5
-rw-r--r--lua_cjson.c5
1 files 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)
1342 1342
1343/* ===== INITIALISATION ===== */ 1343/* ===== INITIALISATION ===== */
1344 1344
1345#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 1345#if !defined(luaL_newlibtable) \
1346/* Compatibility for Lua 5.1. 1346 && (!defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502)
1347/* Compatibility for Lua 5.1 and older LuaJIT.
1347 * 1348 *
1348 * luaL_setfuncs() is used to create a module table where the functions have 1349 * luaL_setfuncs() is used to create a module table where the functions have
1349 * json_config_t as their first upvalue. Code borrowed from Lua 5.2 source. */ 1350 * json_config_t as their first upvalue. Code borrowed from Lua 5.2 source. */