File tree Expand file tree Collapse file tree 7 files changed +10
-37
lines changed
Expand file tree Collapse file tree 7 files changed +10
-37
lines changed Original file line number Diff line number Diff line change 11const Builder = @import ("std" ).build .Builder ;
22
33pub fn build (b : & Builder ) {
4- const exe = b .addCExecutable ("main" );
5- b .addCIncludePath ("." );
6- exe .addCompileFlags ([][]const u8 {
7- "-std=c99" ,
8- "-nostdlib" ,
9- });
10-
11- const source_files = [][]const u8 {
12- "main.c" ,
13- };
14-
15- for (source_files ) | source | {
16- exe .addSourceFile (source );
17- }
18-
19- const zig_source_files = [][]const u8 {
20- "compute.zig" ,
21- "compute_helper.zig" ,
22- "display.zig" ,
23- };
24-
25- for (zig_source_files ) | source | {
26- const object = b .addObject (source , source );
27- exe .addObject (object );
28- }
4+ const exe = b .addExecutable ("main" , "main.zig" );
295
306 exe .setOutputPath ("./main" );
317 b .default_step .dependOn (& exe .step );
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- pub use @import ("compute_helper.zig" );
1+ use @import ("compute_helper.zig" );
22
3- export fn compute (a : u8 ) - > u8 {
3+ pub fn compute (a : u8 ) - > u8 {
44 compute_helper (a ) + 5
55}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11const std = @import ("std" );
22const printf = std .io .stdout .printf ;
33
4- export fn display_char (c : u8 )
4+ pub fn display_char (c : u8 )
55{
66 %% printf ("{c}\n " , c );
77}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ use @import ("display.zig" );
2+ use @import ("compute.zig" );
3+
4+ pub fn main () - > % void {
5+ display_char (compute ('A' ));
6+ }
You can’t perform that action at this time.
0 commit comments