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 {...@@ -636,6 +636,10 @@ test lessThan {
636 try testing.expect(lessThan(u8, "", "a"));636 try testing.expect(lessThan(u8, "", "a"));
637}637}
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
639const eqlBytes_allowed = switch (builtin.zig_backend) {643const eqlBytes_allowed = switch (builtin.zig_backend) {
640 // The SPIR-V backend does not support the optimized path yet.644 // The SPIR-V backend does not support the optimized path yet.
641 .stage2_spirv64 => false,645 .stage2_spirv64 => false,
...@@ -643,7 +647,7 @@ const eqlBytes_allowed = switch (builtin.zig_backend) {...@@ -643,7 +647,7 @@ const eqlBytes_allowed = switch (builtin.zig_backend) {
643 .stage2_riscv64 => false,647 .stage2_riscv64 => false,
644 // The naive memory comparison implementation is more useful for fuzzers to648 // The naive memory comparison implementation is more useful for fuzzers to
645 // find interesting inputs.649 // find interesting inputs.
646 else => !builtin.fuzz,650 else => !fuzz,
647};651};
648652
649/// Compares two slices and returns whether they are equal.653/// Compares two slices and returns whether they are equal.