diff options
| author | ruki <[email protected]> | 2025-11-09 19:51:04 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-11-09 19:51:04 +0800 |
| commit | 91f6ed08fe32e36d555129efa4afdd82113f0eb4 (patch) | |
| tree | 2bfee23488c8479c83833677262ee83b9e362cbb /xmake/templates/c++/xmake.cli | |
| parent | c89c94bf89e98c8e42e786aacc0b334a57474179 (diff) | |
format tests and templates
Diffstat (limited to 'xmake/templates/c++/xmake.cli')
| -rw-r--r-- | xmake/templates/c++/xmake.cli/project/src/lni/main.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/xmake/templates/c++/xmake.cli/project/src/lni/main.cpp b/xmake/templates/c++/xmake.cli/project/src/lni/main.cpp index 80237da16..e8955e074 100644 --- a/xmake/templates/c++/xmake.cli/project/src/lni/main.cpp +++ b/xmake/templates/c++/xmake.cli/project/src/lni/main.cpp @@ -3,26 +3,21 @@ extern "C" { } static tb_byte_t const g_luafiles_data[] = { - #include "luafiles.xmz.h" +#include "luafiles.xmz.h" }; -static tb_int_t lni_test_hello(lua_State* lua) { +static tb_int_t lni_test_hello(lua_State *lua) { lua_pushliteral(lua, "hello xmake!"); return 1; } -static tb_void_t lni_initalizer(xm_engine_ref_t engine, lua_State* lua) { - static luaL_Reg const lni_test_funcs[] = { - {"hello", lni_test_hello} - , {tb_null, tb_null} - }; +static tb_void_t lni_initalizer(xm_engine_ref_t engine, lua_State *lua) { + static luaL_Reg const lni_test_funcs[] = { { "hello", lni_test_hello }, { tb_null, tb_null } }; xm_engine_register(engine, "test", lni_test_funcs); xm_engine_add_embedfiles(engine, g_luafiles_data, sizeof(g_luafiles_data)); } -tb_int_t main(tb_int_t argc, tb_char_t** argv) { - tb_char_t* taskargv[] = {"lua", "-D", "lua.main", tb_null}; +tb_int_t main(tb_int_t argc, tb_char_t **argv) { + tb_char_t *taskargv[] = { "lua", "-D", "lua.main", tb_null }; return xm_engine_run("${TARGETNAME}", argc, argv, taskargv, lni_initalizer); } - - |
