╭ changed ───────╮ │lib/c/string.zig│ ╰────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │68 } │ │69 │ │70 fn memchr(ptr: *const anyopaque, value: c_int, len: usize) callconv(.c) ?*anyopaque { │ │71 + const b: u8 = @truncate(@as(c_uint, @bitCast(value))); │ │72 const bytes: [*]const u8 = @ptrCast(ptr); │ │72 - return @constCast(bytes[std.mem.findScalar(u8, bytes[0..len], @truncate(@as(c_uint, @bitCast(value)))) orelse return null ..]);│ │73 + for (0..len) |i| { │ │74 + if (bytes[i] == b) return @constCast(&bytes[i]); │ │75 + } │ │76 + return null; │ │77 } │ │78 │ │79 fn strcpy(noalias dst: [*]c_char, noalias src: [*:0]const c_char) callconv(.c) [*]c_char { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────╮ │lib/c/wchar.zig│ ╰───────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │46 } │ │47 } │ │48 │ │49 -fn wmemchr(ptr: [*]const wchar_t, value: wchar_t, len: usize) callconv(.c) ?[*]wchar_t { │ │50 - return @constCast(ptr[std.mem.findScalar(wchar_t, ptr[0..len], value) orelse return null ..]);│ │49 +fn wmemchr(ptr: [*]const wchar_t, value: wchar_t, len: usize) callconv(.c) ?*wchar_t { │ │50 + for (0..len) |i| { │ │51 + if (ptr[i] == value) return @constCast(&ptr[i]); │ │52 + } │ │53 + return null; │ │54 } │ │55 │ │56 fn wmemcmp(a: [*]const wchar_t, b: [*]const wchar_t, len: usize) callconv(.c) c_int { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯