diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-09-17 11:11:49 +0200 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2025-09-18 12:42:24 +0200 |
| commit | 4e9b8aec2cbaa9fba7b64b03e90d0426b09e1003 (patch) | |
| tree | 6ca0fcf042f8b164d95b358ebaada7360f77ad51 /test/standalone/static_c_lib/foo.zig | |
| parent | abd73083e423fa1422aa64575e357b85c17a5101 (diff) | |
| download | zig-4e9b8aec2cbaa9fba7b64b03e90d0426b09e1003.tar.gz zig-4e9b8aec2cbaa9fba7b64b03e90d0426b09e1003.zip | |
test: remove unnecessary @cImport usage in some standalone tests
Diffstat (limited to 'test/standalone/static_c_lib/foo.zig')
| -rw-r--r-- | test/standalone/static_c_lib/foo.zig | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/standalone/static_c_lib/foo.zig b/test/standalone/static_c_lib/foo.zig index da02875408..2ff5fadb95 100644 --- a/test/standalone/static_c_lib/foo.zig +++ b/test/standalone/static_c_lib/foo.zig @@ -1,12 +1,14 @@ const std = @import("std"); const expect = std.testing.expect; -const c = @cImport(@cInclude("foo.h")); + +extern fn add(a: u32, b: u32) u32; +extern var foo: u32; test "C add" { - const result = c.add(1, 2); + const result = add(1, 2); try expect(result == 3); } test "C extern variable" { - try expect(c.foo == 12345); + try expect(foo == 12345); } |
