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/native | |
| parent | e7f5e0fc203ebb4adb26365a7e1e4fe9e82e1be7 (diff) | |
add c interop support for zigzig
Diffstat (limited to 'tests/projects/zig/c_interop/src/native')
| -rw-r--r-- | tests/projects/zig/c_interop/src/native/mathlib.c | 9 | ||||
| -rw-r--r-- | tests/projects/zig/c_interop/src/native/mathlib.h | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/projects/zig/c_interop/src/native/mathlib.c b/tests/projects/zig/c_interop/src/native/mathlib.c new file mode 100644 index 000000000..8728d1df3 --- /dev/null +++ b/tests/projects/zig/c_interop/src/native/mathlib.c @@ -0,0 +1,9 @@ +#include "mathlib.h" + +int c_add(int a, int b) { + return a + b; +} + +int c_multiply(int a, int b) { + return a * b; +} diff --git a/tests/projects/zig/c_interop/src/native/mathlib.h b/tests/projects/zig/c_interop/src/native/mathlib.h new file mode 100644 index 000000000..78dcbc931 --- /dev/null +++ b/tests/projects/zig/c_interop/src/native/mathlib.h @@ -0,0 +1,7 @@ +#ifndef MATHLIB_H +#define MATHLIB_H + +int c_add(int a, int b); +int c_multiply(int a, int b); + +#endif |
