From 170cb15f22cf604691f6a7cc55f67eba962021fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Anic=CC=81?= Date: Wed, 14 Feb 2024 19:57:13 +0100 Subject: [PATCH] skip calculating struct sizes on 32 bit platforms --- src/deflate.zig | 2 ++ src/inflate.zig | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/deflate.zig b/src/deflate.zig index eac24aa..a49d170 100644 --- a/src/deflate.zig +++ b/src/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/src/inflate.zig b/src/inflate.zig index 8051df7..68ec2f7 100644 --- a/src/inflate.zig +++ b/src/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));