std.cstr: deprecate namespace

Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
This commit is contained in:
Eric Joldasov
2023-06-25 21:33:55 +06:00
committed by Andrew Kelley
parent 852eb272bf
commit 0a868dacdd
12 changed files with 38 additions and 116 deletions

View File

@@ -153,7 +153,11 @@ test "strncat" {
}
fn strcmp(s1: [*:0]const u8, s2: [*:0]const u8) callconv(.C) c_int {
return std.cstr.cmp(s1, s2);
return switch (std.mem.orderZ(u8, s1, s2)) {
.lt => -1,
.eq => 0,
.gt => 1,
};
}
fn strlen(s: [*:0]const u8) callconv(.C) usize {