Skip to content

Commit 4799c12

Browse files
committed
fix api types and return results
1 parent 7b93988 commit 4799c12

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/lib.zig

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ pub const TCCState = opaque {
5858
}
5959

6060
/// add include path
61-
pub fn add_include_path(self: *TCCState, pathname: [:0]const u8) void {
62-
tcc_add_include_path(self, pathname.ptr);
61+
pub fn add_include_path(self: *TCCState, pathname: [:0]const u8) i32 {
62+
return tcc_add_include_path(self, pathname.ptr);
6363
}
6464

6565
/// add in system include path
66-
pub fn add_sysinclude_path(self: *TCCState, pathname: [:0]const u8) void {
67-
tcc_add_sysinclude_path(self, pathname.ptr);
66+
pub fn add_sysinclude_path(self: *TCCState, pathname: [:0]const u8) i32 {
67+
return tcc_add_sysinclude_path(self, pathname.ptr);
6868
}
6969

7070
/// define preprocessor symbol 'sym'. value can be NULL, sym can be "sym=val"
@@ -84,7 +84,7 @@ pub const TCCState = opaque {
8484
}
8585

8686
/// add multiple files (C file, dll, object, library, ld script)
87-
pub fn add_files(self: *TCCState, filenames: [][:0]const u8) !void {
87+
pub fn add_files(self: *TCCState, filenames: []const [:0]const u8) !void {
8888
for (filenames) |filename|
8989
try self.add_file(filename.ptr);
9090
}
@@ -131,8 +131,7 @@ pub const TCCState = opaque {
131131

132132
/// do all relocations (needed before using get_symbol())
133133
pub fn relocate(self: *TCCState) !void {
134-
const ret = tcc_relocate(self);
135-
if (ret == -1)
134+
if (tcc_relocate(self) == -1)
136135
return error.RelocateError;
137136
}
138137

0 commit comments

Comments
 (0)