diff options
| author | LemonBoy <thatlemon@gmail.com> | 2021-05-07 09:44:33 +0200 |
|---|---|---|
| committer | LemonBoy <thatlemon@gmail.com> | 2021-05-11 12:33:47 +0200 |
| commit | 679876ba7266e6a9eac73705280a39158808bd52 (patch) | |
| tree | d613f7c979820ceb14b6bb5a890fa4fc7da28388 | |
| parent | a909db6aea38f65ffe996d61a62a4f1bd2cbc44c (diff) | |
| download | zig-679876ba7266e6a9eac73705280a39158808bd52.tar.gz zig-679876ba7266e6a9eac73705280a39158808bd52.zip | |
c: Fix prototypes for bcmp and memcmp
They return c_int and not isize.
| -rw-r--r-- | lib/std/special/c.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/special/c.zig b/lib/std/special/c.zig index db0e107def..13e8459b19 100644 --- a/lib/std/special/c.zig +++ b/lib/std/special/c.zig @@ -225,7 +225,7 @@ export fn memmove(dest: ?[*]u8, src: ?[*]const u8, n: usize) callconv(.C) ?[*]u8 return dest; } -export fn memcmp(vl: ?[*]const u8, vr: ?[*]const u8, n: usize) callconv(.C) isize { +export fn memcmp(vl: ?[*]const u8, vr: ?[*]const u8, n: usize) callconv(.C) c_int { @setRuntimeSafety(false); var index: usize = 0; @@ -250,7 +250,7 @@ test "memcmp" { try std.testing.expect(memcmp(base_arr[0..], arr3[0..], base_arr.len) < 0); } -export fn bcmp(vl: [*]allowzero const u8, vr: [*]allowzero const u8, n: usize) callconv(.C) isize { +export fn bcmp(vl: [*]allowzero const u8, vr: [*]allowzero const u8, n: usize) callconv(.C) c_int { @setRuntimeSafety(false); var index: usize = 0; |
