Skip to content

Commit e24d314

Browse files
committed
Replace compute_helper.c with compute_helper.zig
1 parent 8a8f571 commit e24d314

5 files changed

Lines changed: 6 additions & 7 deletions

File tree

build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ pub fn build(b: &Builder) {
99
});
1010

1111
const source_files = [][]const u8 {
12-
"compute_helper.c",
1312
"main.c",
1413
};
1514

@@ -19,6 +18,7 @@ pub fn build(b: &Builder) {
1918

2019
const zig_source_files = [][]const u8 {
2120
"compute.zig",
21+
"compute_helper.zig",
2222
"display.zig",
2323
};
2424

compute.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub use @cImport(@cInclude("compute_helper.h"));
1+
pub use @import("compute_helper.zig");
22

33
export fn compute(a: u8) -> u8 {
44
compute_helper(a) + 5

compute_helper.c

Lines changed: 0 additions & 4 deletions
This file was deleted.

compute_helper.h

Lines changed: 0 additions & 1 deletion
This file was deleted.

compute_helper.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pub fn compute_helper(a: u8) -> u8
2+
{
3+
a + 1
4+
}

0 commit comments

Comments
 (0)