2017-05-02 21:53 GMT-03:00 Daurnimator <quae@xxxxxxxxxxxxxxx>:
On 3 May 2017 at 05:17, Mike Pall <mikelj-1705@xxxxxxx> wrote:
Thibault Charbonnier wrote:with 2.0.5.
On 5/1/17 11:51 PM, Andriy Kornatskyy wrote:
Looks like it breaks lua-cjson... used to be fine with beta2... works
You can find a fix for this on the OpenResty fork:
That's not a good fix and not future-proof at all. Depending on
arbitrary unrelated defines makes this even worse.
A proper compatibility shim without any possibility of a symbol
clash looks like this:
#if LUA_VERSION_NUM < 502
static ... compat_luaL_setfuncs(...)
#define compat_luaL_setfuncs(L, l, nup) luaL_setfuncs(L, l, nup)
And later use it like this:
compat_luaL_setfuncs(L, l, nup);
[Yes, that means you're not using LuaJIT's copy of that function.
But that doesn't make a difference in practice. The function was
added to LuaJIT for the few modules requiring the 5.2 API (and not
probing for it). It's not intended for the majority of modules
that build fine against the 5.1 API.]
In case anyone doesn't know about it, the 'compat-5.3' module does all
of this for you.
I recommend anyone running into this issue to just use that project