diff --git a/core/src/xmake/package/loadxmi.c b/core/src/xmake/package/loadxmi.c index bc2c66e4e42..5d910b85465 100644 --- a/core/src/xmake/package/loadxmi.c +++ b/core/src/xmake/package/loadxmi.c @@ -87,6 +87,7 @@ tb_int_t xm_package_loadxmi(lua_State* lua) { s_luaops._lua_createtable = &lua_createtable; s_luaops._lua_tointegerx = &lua_tointegerx; + s_luaops._lua_toboolean = &lua_toboolean; s_luaops._lua_touserdata = &lua_touserdata; s_luaops._lua_pushinteger = &lua_pushinteger; s_luaops._lua_gettop = &lua_gettop; diff --git a/xmake/scripts/module/xmi.h b/xmake/scripts/module/xmi.h index 0a8cb3e43ea..ecf338a0dd4 100644 --- a/xmake/scripts/module/xmi.h +++ b/xmake/scripts/module/xmi.h @@ -65,6 +65,7 @@ // lua interfaces #define xmi_lua_createtable(lua, narr, nrec) (g_lua_ops)->_lua_createtable(lua, narr, nrec) #define xmi_lua_tointegerx(lua, idx, isnum) (g_lua_ops)->_lua_tointegerx(lua, idx, isnum) +#define xmi_lua_toboolean(lua, idx) (g_lua_ops)->_lua_toboolean(lua, idx) #define xmi_lua_touserdata(lua, idx) (g_lua_ops)->_lua_touserdata(lua, idx) #define xmi_lua_pushinteger(lua, n) (g_lua_ops)->_lua_pushinteger(lua, n) #define xmi_lua_gettop(lua) (g_lua_ops)->_lua_gettop(lua) @@ -121,6 +122,7 @@ # define lua_createtable xmi_lua_createtable # define lua_tointegerx xmi_lua_tointegerx +# define lua_toboolean xmi_lua_toboolean # define lua_touserdata xmi_lua_touserdata # define lua_pushinteger xmi_lua_pushinteger # define lua_gettop xmi_lua_gettop @@ -201,6 +203,7 @@ typedef struct xmi_luaL_Reg_ { typedef struct xmi_lua_ops_t_ { void (*_lua_createtable)(lua_State* lua, int narr, int nrec); lua_Integer (*_lua_tointegerx)(lua_State* lua, int idx, int* isnum); + int (*_lua_toboolean) (lua_State* lua, int idx); void* (*_lua_touserdata)(lua_State* lua, int idx); void (*_lua_pushinteger)(lua_State* lua, lua_Integer n); int (*_lua_gettop)(lua_State* lua);