luaL_openlib replacement for Lua 5.2
问题 I am adapting a library written for Lua < 5.2 and got to a call I don't know the equivalent of: luaL_openlib(L, "Polycore", polycoreLib, 0); Where polycoreLib is a static const struct luaL_Reg polycoreLib [] How can I replace the call to luaL_openlib ? The lua wiki only states: Calls such as luaL_openlib(L, name, lreg, x); should be carefully rewritten because a global table with the given name will be searched and possibly created. 回答1: There's two answers to this: one for replicating the