motiejus/zig

fork of https://codeberg.org/ziglang/zig
git clone https://git.jakstys.lt/motiejus/zig.git
Log | Tree | Refs | README | LICENSE

commit 7802cf9814c135437863ce742b9951d7656849cd (tree)
parent 1741b821c39c3e677719a5db435ddac6190874b2
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Sun, 21 Jul 2024 18:36:01 -0700

avoid depending on a zig1.wasm update

Diffstat:
Mlib/std/mem.zig | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

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