ruki 8 luni în urmă
părinte
comite
ebdc2cbd22

+ 32 - 0
packages/l/libxmake/patches/2.9.8/prefix.patch

@@ -0,0 +1,32 @@
+diff --git a/core/src/xmake/prefix.h b/core/src/xmake/prefix.h
+index 5d6fba582..3c5c0679f 100644
+--- a/core/src/xmake/prefix.h
++++ b/core/src/xmake/prefix.h
+@@ -117,14 +117,21 @@ static __tb_inline__ tb_pointer_t xm_lua_topointer(lua_State* lua, tb_int_t idx)
+ static __tb_inline__ tb_void_t xm_lua_register(lua_State *lua, tb_char_t const* libname, luaL_Reg const* l)
+ {
+ #if LUA_VERSION_NUM >= 504
+-    lua_getglobal(lua, libname);
+-    if (lua_isnil(lua, -1))
++    if (libname)
+     {
+-        lua_pop(lua, 1);
+-        lua_newtable(lua);
++        lua_getglobal(lua, libname);
++        if (lua_isnil(lua, -1))
++        {
++            lua_pop(lua, 1);
++            lua_newtable(lua);
++        }
++        luaL_setfuncs(lua, l, 0);
++        lua_setglobal(lua, libname);
++    }
++    else
++    {
++        luaL_setfuncs(lua, l, 0);
+     }
+-    luaL_setfuncs(lua, l, 0);
+-    lua_setglobal(lua, libname);
+ #else
+     luaL_register(lua, libname, l);
+ #endif

+ 2 - 0
packages/l/libxmake/xmake.lua

@@ -12,6 +12,8 @@ package("libxmake")
     add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
     add_configs("embed", {description = "Embed lua scripts.", default = true, type = "boolean"})
 
+    add_patches("2.9.8", "patches/2.9.8/prefix.patch", "559e953aab37c54296074de5da88562b410c2b01f859984a054b94468ca751ac")
+
     add_includedirs("include")
     if is_plat("windows") then
         add_ldflags("/export:malloc", "/export:free", "/export:memmove")