From 646560c834aa942a93dc677874289649ac1ca9f8 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Fri, 4 Mar 2022 13:26:39 -0700 Subject: [PATCH] glfw: remove alignment from packed structs / fix compilation with latest Zig Not sure why we had these here, but alignment on a packed struct seems somewhat nonsensical (after all, it's fields are packed as closely together as possible so what would alignment refer to?) removing seems fine and fixes compilation with latest Zig: ``` /Users/slimsag/Desktop/hexops/mach/gpu-dawn/libs/mach-glfw/src/hat.zig:8:20: error: unable to override alignment of packed struct fields up: bool align(@alignOf(u8)) = false, ^ /Users/slimsag/Desktop/hexops/mach/gpu-dawn/libs/mach-glfw/src/mod.zig:10:23: error: unable to override alignment of packed struct fields shift: bool align(@alignOf(c_int)) = false, ``` ^ Signed-off-by: Stephen Gutekanst --- glfw/src/hat.zig | 2 +- glfw/src/mod.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/glfw/src/hat.zig b/glfw/src/hat.zig index bf662436..52101595 100644 --- a/glfw/src/hat.zig +++ b/glfw/src/hat.zig @@ -5,7 +5,7 @@ const c = @import("c.zig").c; /// /// See glfw.Joystick.getHats for how these are used. pub const Hat = packed struct { - up: bool align(@alignOf(u8)) = false, + up: bool = false, right: bool = false, down: bool = false, left: bool = false, diff --git a/glfw/src/mod.zig b/glfw/src/mod.zig index fdc8005a..d1cd45df 100644 --- a/glfw/src/mod.zig +++ b/glfw/src/mod.zig @@ -7,7 +7,7 @@ const c = @import("c.zig").c; // must be in sync with GLFW C constants in modifier group, search for "@defgroup mods Modifier key flags" /// A bitmask of all key modifiers pub const Mods = packed struct { - shift: bool align(@alignOf(c_int)) = false, + shift: bool = false, control: bool = false, alt: bool = false, super: bool = false,