diff options
| author | ruki <[email protected]> | 2024-04-04 00:24:53 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-04-04 00:24:53 +0800 |
| commit | b0bc1ce397bb4b700c989df01d11b65b72ca800f (patch) | |
| tree | a8382840fd0c628a8b05b11752f8a8819096fcad /xmake/scripts/module | |
| parent | fee2d1b5106761728134c179375c73f9283a7ba1 (diff) | |
fix xmiopen
Diffstat (limited to 'xmake/scripts/module')
| -rw-r--r-- | xmake/scripts/module/xmi.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/xmake/scripts/module/xmi.h b/xmake/scripts/module/xmi.h index d20f8242f..aa45e9bb1 100644 --- a/xmake/scripts/module/xmi.h +++ b/xmake/scripts/module/xmi.h @@ -29,19 +29,29 @@ /* ////////////////////////////////////////////////////////////////////////////////////// * macros */ + +// lua interfaces #define xmi_lua_createtable(lua, narr, nrec) (g_lua_ops)->_lua_createtable(lua, narr, nrec) #define xmi_lua_newtable(lua) xmi_lua_createtable(lua, 0, 0) +// luaL interfaces +#define xmi_luaL_setfuncs(lua, narr, nrec) (g_lua_ops)->_luaL_setfuncs(lua, narr, nrec) + +/* we cannot redefine lua functions in loadxmi.c, + * because original lua.h has been included + */ #ifndef LUA_VERSION # define lua_createtable xmi_lua_createtable # define lua_newtable xmi_lua_newtable +# define luaL_setfuncs xmi_luaL_setfuncs + # define luaL_Reg xmi_luaL_Reg # define lua_State xmi_lua_State #endif // define lua module entry function -#define xmiopen(name, lua) \ +#define luaopen(name, lua) \ __dummy = 1; \ xmi_lua_ops_t* g_lua_ops; \ int xmisetup(xmi_lua_ops_t* ops) { \ @@ -64,7 +74,8 @@ typedef struct xmi_luaL_Reg_ { }xmi_luaL_Reg; typedef struct xmi_lua_ops_t_ { - void (*_lua_createtable)(lua_State* lua, int narr, int nrec); + void (*_lua_createtable)(lua_State* lua, int narr, int nrec); + void (*_luaL_setfuncs)(lua_State* lua, const luaL_Reg* l, int nup); }xmi_lua_ops_t; /* ////////////////////////////////////////////////////////////////////////////////////// |
