mirror of
https://github.com/ziglang/zig.git
synced 2026-02-16 06:18:32 +00:00
c: Fix prototypes for bcmp and memcmp
They return c_int and not isize.
This commit is contained in:
parent
a909db6aea
commit
679876ba72
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user