Re: [ANN] LuaJIT-2.1.0-beta3

  • From: Thibault Charbonnier <thibaultcha@xxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Tue, 2 May 2017 12:21:16 -0700

On 5/2/17 12:17 PM, Mike Pall wrote:

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(...)
{
   ...
}
#else
#define compat_luaL_setfuncs(L, l, nup) luaL_setfuncs(L, l, nup)
#endif

And later use it like this:

...
   compat_luaL_setfuncs(L, l, nup);
...

Good to know, thanks for the suggestion!

--
Thibault

Other related posts: