floooh / sokol-zig

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

zig-devel broke some type casts in devel versions this week #40

Closed jannehellsten closed 1 year ago

jannehellsten commented 1 year ago

Here's a diff against some older version of sokol for reference.

zig-churn.txt

(There's also some extra commas as I accidentally ran the source through zig fmt in VSCode. Might not be a bad idea to use zig fmt for all the sources so that patches sent won't show large whitespace diffs.)

floooh commented 1 year ago

Could this be related to this (to be merged) PR?

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

Apparently Zig changed the type cast builtins so that the target type comes before the source type (e.g.@intToEnum becomes @enumFromInt).

nurpax commented 1 year ago

It's related but the patch in #39 is already out of date. :) It affects things like @intCast(dest_type, value) that's now just @intCast(value) (dest type is inferred).

See https://ziggit.dev/t/major-zig-language-update-just-landed-removal-of-destination-type-from-all-cast-builtins/898/1 for more info.

floooh commented 1 year ago

Ah, inferring the dest type is a lot nicer I must say :)

GeezerLMAO commented 1 year ago

Working on updating the PR

floooh commented 1 year ago

Closing this ticket, because all related PRs have been merged.