From 70a2a0afd5072dbe77d50f5616a44b2bcba72581 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Thu, 8 May 2025 19:28:28 -0500 Subject: [PATCH] better ABI check for apprt.Action.CValue --- src/apprt/action.zig | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/apprt/action.zig b/src/apprt/action.zig index 6c33a296f..79f8740d2 100644 --- a/src/apprt/action.zig +++ b/src/apprt/action.zig @@ -1,5 +1,4 @@ const std = @import("std"); -const builtin = @import("builtin"); const assert = std.debug.assert; const apprt = @import("../apprt.zig"); const configpkg = @import("../config.zig"); @@ -364,12 +363,10 @@ pub const Action = union(Key) { // For ABI compatibility, we expect that this is our union size. // At the time of writing, we don't promise ABI compatibility // so we can change this but I want to be aware of it. - assert(@sizeOf(CValue) == switch (builtin.target.os.tag) { - .windows => switch (builtin.target.cpu.arch) { - .x86 => 16, - else => 24, - }, - else => 24, + assert(@sizeOf(CValue) == switch (@sizeOf(usize)) { + 4 => 16, + 8 => 24, + else => unreachable, }); }