From f716446fa869ef4dc9663d69a3e4364ef2dcbb6b Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 3 Apr 2024 23:55:17 +0800 Subject: use xmi.h --- core/src/xmake/package/loadxmi.c | 8 ++++++-- core/src/xmake/xmake.lua | 1 + core/src/xmake/xmake.sh | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'core/src') diff --git a/core/src/xmake/package/loadxmi.c b/core/src/xmake/package/loadxmi.c index d45fda3bb..db4091431 100644 --- a/core/src/xmake/package/loadxmi.c +++ b/core/src/xmake/package/loadxmi.c @@ -29,11 +29,12 @@ * includes */ #include "prefix.h" +#include "xmi.h" /* ////////////////////////////////////////////////////////////////////////////////////// * types */ -typedef int (*xm_open_func_t)(lua_State* lua); +typedef int (*xm_open_func_t)(xmi_lua_State* lua); /* ////////////////////////////////////////////////////////////////////////////////////// * implementation @@ -68,5 +69,8 @@ tb_int_t xm_package_loadxmi(lua_State* lua) } // load module - return func(lua); + xmi_lua_State xmi_lua = {0}; + xmi_lua._lua = lua; + xmi_lua._lua_createtable = &lua_createtable; + return func(&xmi_lua); } diff --git a/core/src/xmake/xmake.lua b/core/src/xmake/xmake.lua index 03e733c9a..15702c808 100644 --- a/core/src/xmake/xmake.lua +++ b/core/src/xmake/xmake.lua @@ -29,6 +29,7 @@ target("xmake") add_includedirs("..", {interface = true}) add_includedirs("$(buildir)/$(plat)/$(arch)/$(mode)", {public = true}) add_includedirs("../xxhash") + add_includedirs("$(projectdir)/../xmake/scripts/module") -- add header files add_headerfiles("../(xmake/*.h)") diff --git a/core/src/xmake/xmake.sh b/core/src/xmake/xmake.sh index 5a3cbe1d0..62af5b2fa 100755 --- a/core/src/xmake/xmake.sh +++ b/core/src/xmake/xmake.sh @@ -50,6 +50,7 @@ target "xmake" add_includedirs ".." "{public}" add_includedirs "${buildir}/${plat}/${arch}/${mode}" "{public}" add_includedirs "../xxhash" + add_includedirs "${projectdir}/xmake/scripts/module" # add the common source files add_files "*.c" -- cgit v1.3.1