From 19ef72f788a58ef93481e2412da9fe4934e57c35 Mon Sep 17 00:00:00 2001 From: halx99 Date: Sat, 27 Mar 2021 19:49:06 +0800 Subject: [PATCH] Properly set gc mode for lua-5.4 [ci build] --- extensions/scripting/lua-bindings/manual/CCLuaStack.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp b/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp index 2e97cf769f..00dd78b973 100644 --- a/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp +++ b/extensions/scripting/lua-bindings/manual/CCLuaStack.cpp @@ -94,6 +94,11 @@ namespace { return 0; } + + int lua_version(lua_State* L) { + lua_pushinteger(L, LUA_VERSION_NUM); + return 1; + } } NS_CC_BEGIN @@ -132,6 +137,7 @@ bool LuaStack::init() const luaL_Reg global_functions [] = { {"print", lua_print}, {"release_print",lua_release_print}, + {"version", lua_version}, {nullptr, nullptr} }; luaL_register(_state, "_G", global_functions);