From da64eba068ae2fc11dff8b190164451e8d174a3b Mon Sep 17 00:00:00 2001 From: Daniel Hooper Date: Mon, 11 Nov 2024 07:38:52 -0800 Subject: [PATCH 1/2] fix mask struct to match definition in mach/exception_types.h --- lib/std/c/darwin.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/std/c/darwin.zig b/lib/std/c/darwin.zig index 573f29150d94..15888260a884 100644 --- a/lib/std/c/darwin.zig +++ b/lib/std/c/darwin.zig @@ -59,6 +59,7 @@ pub const EXC = enum(exception_type_t) { pub const SOFT_SIGNAL = 0x10003; pub const MASK = packed struct(u32) { + _bit0_unused: bool = false, BAD_ACCESS: bool = false, BAD_INSTRUCTION: bool = false, ARITHMETIC: bool = false, @@ -72,6 +73,7 @@ pub const EXC = enum(exception_type_t) { RESOURCE: bool = false, GUARD: bool = false, CORPSE_NOTIFY: bool = false, + _pad: u18 = 0, pub const MACHINE: MASK = @bitCast(@as(u32, 0)); From c2d81ac87a7920c08b2043630fe69d685bbe6b9e Mon Sep 17 00:00:00 2001 From: Daniel Hooper Date: Tue, 12 Nov 2024 13:28:01 -0800 Subject: [PATCH 2/2] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Alex Rønne Petersen --- lib/std/c/darwin.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/c/darwin.zig b/lib/std/c/darwin.zig index 15888260a884..b925a15942e1 100644 --- a/lib/std/c/darwin.zig +++ b/lib/std/c/darwin.zig @@ -59,7 +59,7 @@ pub const EXC = enum(exception_type_t) { pub const SOFT_SIGNAL = 0x10003; pub const MASK = packed struct(u32) { - _bit0_unused: bool = false, + _0: u1 = 0, BAD_ACCESS: bool = false, BAD_INSTRUCTION: bool = false, ARITHMETIC: bool = false, @@ -73,7 +73,7 @@ pub const EXC = enum(exception_type_t) { RESOURCE: bool = false, GUARD: bool = false, CORPSE_NOTIFY: bool = false, - _pad: u18 = 0, + _14: u18 = 0, pub const MACHINE: MASK = @bitCast(@as(u32, 0));