zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit d49cdf5b2d2e30ab9188c54e359f19768d890bf3 (tree)
parent c2361bf54808da49393e892b81bdff45c68c4c51
Author: Igor Anić <igor.anic@gmail.com>
Date:   Wed, 14 Feb 2024 19:58:45 +0100

skip calculating struct sizes on 32 bit platforms

Diffstat:
Mlib/std/compress/flate/deflate.zig | 2++
Mlib/std/compress/flate/inflate.zig | 2++
2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lib/std/compress/flate/deflate.zig b/lib/std/compress/flate/deflate.zig @@ -603,6 +603,8 @@ const TestTokenWriter = struct { }; test "flate.Deflate struct sizes" { + if (@sizeOf(usize) != 8) return error.SkipZigTest; + try expect(@sizeOf(Token) == 4); // list: (1 << 15) * 4 = 128k + pos: 8 diff --git a/lib/std/compress/flate/inflate.zig b/lib/std/compress/flate/inflate.zig @@ -342,6 +342,8 @@ pub fn Inflate(comptime container: Container, comptime ReaderType: type) type { } test "flate.Inflate struct sizes" { + if (@sizeOf(usize) != 8) return error.SkipZigTest; + var fbs = std.io.fixedBufferStream(""); const ReaderType = @TypeOf(fbs.reader()); const inflate_size = @sizeOf(Inflate(.gzip, ReaderType));