glfw: remove alignment from packed structs / fix compilation with latest Zig #177

Merged
emidoots merged 1 commit from sg/glfw-alignment into main 2022-03-04 22:48:41 +00:00
emidoots commented 2022-03-04 22:43:03 +00:00 (Migrated from github.com)

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 stephen@hexops.com

  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
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 <stephen@hexops.com> - [x] By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach!177
No description provided.