Skip to content

Fixups for zig 0.16.x#23

Draft
kcbanner wants to merge 2 commits into
zig-gamedev:mainfrom
kcbanner:0.16.x_io
Draft

Fixups for zig 0.16.x#23
kcbanner wants to merge 2 commits into
zig-gamedev:mainfrom
kcbanner:0.16.x_io

Conversation

@kcbanner
Copy link
Copy Markdown
Collaborator

@kcbanner kcbanner commented Feb 8, 2026

Opening this PR now for anyone that needs these changes ahead of the 0.16.0 release. This will be updated with any other breaking changes.

  • Update to the new std.Io.Mutex API
  • refAllDeclsRecursive -> refAllDecls

- `refAllDeclsRecursive` -> `refAllDecls`
@OndraVoves
Copy link
Copy Markdown

I just tested this on my project. It works fine on Linux and macOS, but the compilation fails on Windows. I still have to sort out a few other things, so I can't send a fix yet, but it looks like adding @alignCast in a few places should do the trick.

@kcbanner
Copy link
Copy Markdown
Collaborator Author

Just pushed a commit that migrates to translate-c from the now-removed @cImport.

I just tested this on my project. It works fine on Linux and macOS, but the compilation fails on Windows. I still have to sort out a few other things, so I can't send a fix yet, but it looks like adding @aligncast in a few places should do the trick.

Ah, I was compiling against -msvc on windows. I see for -gnu that the asserts against the size of the C structs are tripping, I think this regressed when translate-c switched from clang to aro. This was a related change I made to arocc at the time: Vexu/arocc#897

I'll have to look into what's going on with -gnu translation.

@kcbanner
Copy link
Copy Markdown
Collaborator Author

Looks like the -gnu translation does not include the correct align(16), but the msvc one does.

❯ type .zig-cache\\o\\31afaf260e8ed77d0d1496548f1160a3\\c.zig | rg "struct_JPC_Body = " -A 2
pub const struct_JPC_Body = extern struct {
    position: [4]JPC_Real = @import("std").mem.zeroes([4]JPC_Real),
    rotation: [4]f32 = @import("std").mem.zeroes([4]f32),

❯ type .zig-cache\\o\\96191d083d9965976b2f845b8ac2f605\\c.zig | rg "struct_JPC_Body = " -A 2
pub const struct_JPC_Body = extern struct {
    position: [4]JPC_Real align(16) = @import("std").mem.zeroes([4]JPC_Real),
    rotation: [4]f32 = @import("std").mem.zeroes([4]f32),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants