Skip to content

Commit 8a8f571

Browse files
committed
Replace display.c with display.zig
1 parent c74cba4 commit 8a8f571

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

build.zig

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ pub fn build(b: &Builder) {
44
const exe = b.addCExecutable("main");
55
b.addCIncludePath(".");
66
exe.addCompileFlags([][]const u8 {
7-
"-std=c99"
7+
"-std=c99",
8+
"-nostdlib",
89
});
910

1011
const source_files = [][]const u8 {
1112
"compute_helper.c",
12-
"display.c",
13-
"main.c"
13+
"main.c",
1414
};
1515

1616
for (source_files) |source| {
@@ -19,6 +19,7 @@ pub fn build(b: &Builder) {
1919

2020
const zig_source_files = [][]const u8 {
2121
"compute.zig",
22+
"display.zig",
2223
};
2324

2425
for (zig_source_files) |source| {

display.c

-6
This file was deleted.

display.zig

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const std = @import("std");
2+
const printf = std.io.stdout.printf;
3+
4+
export fn display_char(c: u8)
5+
{
6+
%%printf("{c}\n", c);
7+
}

0 commit comments

Comments
 (0)