From 6b38f54853ae0997d8dea5b1a8e0acf385a8118e Mon Sep 17 00:00:00 2001 From: Ryan Schneider Date: Thu, 27 Oct 2022 18:05:58 +0000 Subject: [PATCH] fix arm64 alignment issues in signal() --- src/cstd.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cstd.zig b/src/cstd.zig index 190088d..428f45b 100644 --- a/src/cstd.zig +++ b/src/cstd.zig @@ -536,12 +536,12 @@ export fn strerror(errnum: c_int) callconv(.C) [*:0]const u8 { // -------------------------------------------------------------------------------- const SignalFn = switch (builtin.zig_backend) { .stage1 => fn(c_int) callconv(.C) void, - else => *const fn(c_int) callconv(.C) void, + else => *align(1) const fn(c_int) callconv(.C) void, }; export fn signal(sig: c_int, func: SignalFn) callconv(.C) ?SignalFn { if (builtin.os.tag == .linux) { var action = std.os.Sigaction{ - .handler = .{ .handler = func }, + .handler = .{ .handler = @alignCast(@alignOf(fn(c_int) callconv(.C) void), func) }, .mask = std.os.linux.empty_sigset, .flags = std.os.SA.RESTART, .restorer = null,