Skip to content

Commit

Permalink
bugfix: conditionally build luaL_setfuncs() function as the latest Lu…
Browse files Browse the repository at this point in the history
…aJIT v2.1 already includes it. fixes #21.
  • Loading branch information
dndx authored and agentzh committed Apr 5, 2017
1 parent fd35fd9 commit 55d22ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua_cjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 55d22ef

Please sign in to comment.