summaryrefslogtreecommitdiff
path: root/xmake/templates/zig/shared/src
diff options
context:
space:
mode:
authorruki <[email protected]>2026-08-09 18:06:16 +0800
committerruki <[email protected]>2026-08-09 18:06:16 +0800
commit5f5daf64c504e1103a355f45bf925a5149b03e24 (patch)
treeaf4d584b3c7badc1df56038cdb29099b4f3e99fd /xmake/templates/zig/shared/src
parent6ac4ea833193a4319a1eb6e5f588d1877fd48064 (diff)
move templates dir
Diffstat (limited to 'xmake/templates/zig/shared/src')
-rw-r--r--xmake/templates/zig/shared/src/main.zig7
-rw-r--r--xmake/templates/zig/shared/src/test.zig3
2 files changed, 10 insertions, 0 deletions
diff --git a/xmake/templates/zig/shared/src/main.zig b/xmake/templates/zig/shared/src/main.zig
new file mode 100644
index 000000000..7dc7b2bc4
--- /dev/null
+++ b/xmake/templates/zig/shared/src/main.zig
@@ -0,0 +1,7 @@
+const std = @import("std");
+
+extern fn add(a: i32, b: i32) i32;
+
+pub fn main() !void {
+ std.debug.print("Hello, {s} - {d}!\n", .{"world", add(1, 1)});
+}
diff --git a/xmake/templates/zig/shared/src/test.zig b/xmake/templates/zig/shared/src/test.zig
new file mode 100644
index 000000000..a04ec1544
--- /dev/null
+++ b/xmake/templates/zig/shared/src/test.zig
@@ -0,0 +1,3 @@
+export fn add(a: i32, b: i32) i32 {
+ return a + b;
+}