diff options
| author | ruki <[email protected]> | 2026-02-28 21:55:13 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-02-28 21:55:13 +0800 |
| commit | 5280c9480cb0d7d3ab55d516e296152ec273e14a (patch) | |
| tree | af041546121010fdad5639c231ad2b2a4900aa12 /xmake/templates/zig/shared/src | |
| parent | 71e10b70334401d46c47f574c8f46fcd20ccf818 (diff) | |
rewrite templates
Diffstat (limited to 'xmake/templates/zig/shared/src')
| -rw-r--r-- | xmake/templates/zig/shared/src/main.zig | 7 | ||||
| -rw-r--r-- | xmake/templates/zig/shared/src/test.zig | 3 |
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; +} |
