lua-users home
lua-l archive

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


On Tue, Jun 26, 2018 at 2:32 PM, Andrew Gierth wrote:

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?

#ifndef USE_BUG_WORKAROUND
    int lua_ver = lua_version_release(L);
    if (lua_ver >= 50303 && lua_ver < 50305)
        luaL_error(L, "Recompile with correct lua version");
#endif


Host program should be able to read lua_ident[0] (declared in "lua.h") to detect Lua release in runtime.
This is a string, not a number.