authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-07-21 18:36:01-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-07-22 13:07:02-07:00
log7802cf9814c135437863ce742b9951d7656849cd
treef89ce8b936b242d1161c9ad25c6511ba56b29c68
parent1741b821c39c3e677719a5db435ddac6190874b2

avoid depending on a zig1.wasm update


1 files changed, 5 insertions(+), 1 deletions(-)

lib/std/mem.zig+5-1
......@@ -636,6 +636,10 @@ test lessThan {
636636 try testing.expect(lessThan(u8, "", "a"));
637637}
638638
639/// Normally, we could simply use `builtin.fuzz` but this requires a zig1.wasm
640/// update. After the next zig1.wasm update, the `@hasDecl` can be removed.
641const fuzz = @hasDecl(builtin, "fuzz") and builtin.fuzz;
642
639643const eqlBytes_allowed = switch (builtin.zig_backend) {
640644 // The SPIR-V backend does not support the optimized path yet.
641645 .stage2_spirv64 => false,
......@@ -643,7 +647,7 @@ const eqlBytes_allowed = switch (builtin.zig_backend) {
643647 .stage2_riscv64 => false,
644648 // The naive memory comparison implementation is more useful for fuzzers to
645649 // find interesting inputs.
646 else => !builtin.fuzz,
650 else => !fuzz,
647651};
648652
649653/// Compares two slices and returns whether they are equal.