lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

>>>>> "Luiz" == Luiz Henrique de Figueiredo <> writes:

 Luiz> Lua 5.3.5 fixes all bugs listed in .

So a question that comes to mind is this: why is there no sane way for
the host program to detect the Lua minor version either at compile time
or runtime? In my code I have to expend a _lot_ of effort on a
workaround for one of the 5.3.4 bugs, but there's no good way for me to
detect whether I'm actually building against 5.3.5 in order to skip
doing that.

(The only record of the minor version seems to be LUA_VERSION_RELEASE,
which is a string and not a number so it can't be used for conditionals
without doing ugly makefile tricks.)

What I _want_ to be able to do is something like:


and later,

    int lua_ver = lua_version_release(L);
     * if we're not using the workaround, check that we don't have the
     * bug.
    if (lua_ver >= 50303 && lua_ver < 50305)
        luaL_error(L, "Recompile with correct lua version");

But without minor version checks, I'm stuck having to use the workaround
all the time whether it's really needed or not.