Repository navigation
Port zig-interface to Zig 0.17 - #12
Merged
Merged
Conversation
Replace removed StructField and std.meta.fields usage with the struct-of-arrays @typeinfo layout, and require Zig 0.17.0. Co-authored-by: Steve Manuel <[email protected]>
std.meta.fields is a compile error on Zig 0.17. Co-authored-by: Steve Manuel <[email protected]>
Embedding and wrapper generation reuse those arrays instead of reflecting the finished vtable struct. Co-authored-by: Steve Manuel <[email protected]>
Builds against 0.16 or 0.15 should use a pinned compatible release. Co-authored-by: Steve Manuel <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates the library for Zig 0.17.0’s struct-of-arrays type reflection, and stops reflecting a finished vtable to copy it into a parent.
src/interface.zignow:field_names/field_types/field_values/param_types/attrs*anyopaquein that buildvtable_field_namesandvtable_field_types, rather than@typeInfoon its generatedVTable@backingIntandbuiltin.target.ostest/vtable.zigreads the generated vtable’s field names with@typeInfo(VTableType).@"struct".field_namesinstead ofstd.meta.fields.Interface declarations stay
fn (User) anyerror!u32. Call sites stayrepo.vtable.create(repo.ptr, user).minimum_zig_versionis0.17.0. The README and CI say the same thing the 0.16 port said for its compiler: Requires Zig 0.17+. Older Zig versions should depend on a pinned 0.16- or 0.15-compatible release. CI tests Zig 0.17.0.Verification
zig build testwith Zig 0.17.0: 15/15 steps succeeded, 28/28 tests passed.