diff options
| author | ruki <[email protected]> | 2026-03-28 00:48:45 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-03-28 00:48:45 +0800 |
| commit | bec4169441e5cd07fc14e886a1759b1f879ca06c (patch) | |
| tree | da914fffe17f12079e69dbb7e28a94e67c7ed56e /tests/projects/zig/c_interop/src/main.zig | |
| parent | e7f5e0fc203ebb4adb26365a7e1e4fe9e82e1be7 (diff) | |
add c interop support for zigzig
Diffstat (limited to 'tests/projects/zig/c_interop/src/main.zig')
| -rw-r--r-- | tests/projects/zig/c_interop/src/main.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/projects/zig/c_interop/src/main.zig b/tests/projects/zig/c_interop/src/main.zig new file mode 100644 index 000000000..6cd61100d --- /dev/null +++ b/tests/projects/zig/c_interop/src/main.zig @@ -0,0 +1,11 @@ +const std = @import("std"); +const c = @cImport({ + @cInclude("mathlib.h"); +}); + +pub fn main() void { + const sum = c.c_add(3, 4); + const product = c.c_multiply(5, 6); + std.debug.print("c_add(3,4)={d}\n", .{sum}); + std.debug.print("c_multiply(5,6)={d}\n", .{product}); +} |
