summaryrefslogtreecommitdiff
path: root/xmake/templates/c++/module.shared
diff options
context:
space:
mode:
authorruki <[email protected]>2025-11-10 06:35:04 +0800
committerGitHub <[email protected]>2025-11-10 06:35:04 +0800
commit2b01e46fcf619aaecb8435b0fac975e3aff0587f (patch)
tree8f005a8dfc3272e9f027560e5e1b5881a7a8bc70 /xmake/templates/c++/module.shared
parenta1b0ec856e2c22aac84022feb05b6687912e3d6e (diff)
parent2c387895657ae13cd717d7f42f5baed5eb028a8e (diff)
Merge pull request #7008 from xmake-io/format
format code
Diffstat (limited to 'xmake/templates/c++/module.shared')
-rw-r--r--xmake/templates/c++/module.shared/project/modules/shared/foo/src/foo.cpp13
-rw-r--r--xmake/templates/c++/module.shared/project/src/main.cpp2
2 files changed, 5 insertions, 10 deletions
diff --git a/xmake/templates/c++/module.shared/project/modules/shared/foo/src/foo.cpp b/xmake/templates/c++/module.shared/project/modules/shared/foo/src/foo.cpp
index a98baca02..adde214ca 100644
--- a/xmake/templates/c++/module.shared/project/modules/shared/foo/src/foo.cpp
+++ b/xmake/templates/c++/module.shared/project/modules/shared/foo/src/foo.cpp
@@ -1,27 +1,22 @@
#include <xmi.h>
-static int add(lua_State* lua) {
+static int add(lua_State *lua) {
int a = lua_tointeger(lua, 1);
int b = lua_tointeger(lua, 2);
lua_pushinteger(lua, a + b);
return 1;
}
-static int sub(lua_State* lua) {
+static int sub(lua_State *lua) {
int a = lua_tointeger(lua, 1);
int b = lua_tointeger(lua, 2);
lua_pushinteger(lua, a - b);
return 1;
}
-int luaopen(foo, lua_State* lua) {
- static const luaL_Reg funcs[] = {
- {"add", add},
- {"sub", sub},
- {NULL, NULL}
- };
+int luaopen(foo, lua_State *lua) {
+ static const luaL_Reg funcs[] = { { "add", add }, { "sub", sub }, { NULL, NULL } };
lua_newtable(lua);
luaL_setfuncs(lua, funcs, 0);
return 1;
}
-
diff --git a/xmake/templates/c++/module.shared/project/src/main.cpp b/xmake/templates/c++/module.shared/project/src/main.cpp
index 7c775d288..9b6abffea 100644
--- a/xmake/templates/c++/module.shared/project/src/main.cpp
+++ b/xmake/templates/c++/module.shared/project/src/main.cpp
@@ -1,6 +1,6 @@
#include <iostream>
-int main(int argc, char** argv) {
+int main(int argc, char **argv) {
std::cout << "hello world!" << std::endl;
return 0;
}