authorgravatar for here-leslie-lau@noreply.codeberg.orgLeslie Lau <here-leslie-lau@noreply.codeberg.org> 2026-03-17 18:59:28+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-03-17 18:59:28+01:00
log4d5721214f31684e3bed3624878d8903fabe8e39
tree7a5b605374794e125eb9d517c3a0b5f68f369a18
parentb483ec28e389130af63a6924276db6eef8ea4020

fix (Io/Dispatch): alignment type reflection compile errors (#31538)

Fixes compilation errors when using Io.Evented on macOS. closes #31526 Co-authored-by: Leslie-Lau <804738464@qq.com> Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31538 Co-authored-by: Leslie Lau <here-leslie-lau@noreply.codeberg.org> Co-committed-by: Leslie Lau <here-leslie-lau@noreply.codeberg.org>

1 files changed, 3 insertions(+), 4 deletions(-)

lib/std/Io/Dispatch.zig+3-4
...@@ -719,10 +719,9 @@ const Cancelable = struct {...@@ -719,10 +719,9 @@ const Cancelable = struct {
719 queue: c.dispatch.queue_t,719 queue: c.dispatch.queue_t,
720 cancel: c.dispatch.function_t,720 cancel: c.dispatch.function_t,
721721
722 const is_blocked: c.dispatch.function_t =722 const fn_ptr_align = std.meta.alignment(c.dispatch.function_t);
723 @ptrFromInt(@typeInfo(c.dispatch.function_t).pointer.alignment * 1);723 const is_blocked: c.dispatch.function_t = @ptrFromInt(fn_ptr_align * 1);
724 const is_requested: c.dispatch.function_t =724 const is_requested: c.dispatch.function_t = @ptrFromInt(fn_ptr_align * 2);
725 @ptrFromInt(@typeInfo(c.dispatch.function_t).pointer.alignment * 2);
726725
727 const blocked: Cancelable = .{ .queue = undefined, .cancel = is_blocked };726 const blocked: Cancelable = .{ .queue = undefined, .cancel = is_blocked };
728727