Commit 679876ba72

LemonBoy <thatlemon@gmail.com>
2021-05-07 09:44:33
c: Fix prototypes for bcmp and memcmp
They return c_int and not isize.
1 parent a909db6
Changed files (1)
lib
std
special
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;