floooh / sokol-zig

Zig bindings for the sokol headers (https://github.com/floooh/sokol)
zlib License
341 stars 46 forks source link

Change `var`s to `const`s #49

Closed noncom closed 8 months ago

noncom commented 8 months ago

Though the readme officially says that the bindings are compatible with Zig 0.11, in reality they are perfectly compatible with Zig 0.12 as well, except having a conflict with one of the cornerstone features of that version. A conflict that is easy to fix though!

As you might know, Zig 0.12 introduces a new error about having unchanged vars in your code: https://ziggit.dev/t/error-local-variable-is-never-mutated/2238

So while Zig 0.12 is still in dev, fixing this problem would make them compatible without breaking anything, even if the official support still stays on Zig 0.11 for now. But it would remove the hindrance when updating from the repository. So it would be great if the bindings were updated to get rid of this "sloppy code".

floooh commented 8 months ago

I think this should be resolved by two PRs, one is already merged:

https://github.com/floooh/sokol/pull/948

...and the other I'm going to merge now:

https://github.com/floooh/sokol-zig/pull/47

floooh commented 8 months ago

Ok, second PR has been merged, should be all good now. I did a quick test with 0.12.0-dev.1773+8a8fd47d2 and the examples work. Closing this ticket.