Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate anonymous union/struct #4081

Closed
wants to merge 3 commits into from

Conversation

LemonBoy
Copy link
Contributor

@LemonBoy LemonBoy commented Jan 5, 2020

Together with #4078 should fix all the problems with #2257

@LemonBoy
Copy link
Contributor Author

LemonBoy commented Jan 5, 2020

@Vexu The weird behavior you've observed is because clang acts as MSVC-compatible when on Windows. Check out the difference between clang-9 --target=x86_64-windows-none -Xclang -ast-dump <c file> and clang-9 --target=x86_64-windows-gnu -Xclang -ast-dump <c file>.

@LemonBoy
Copy link
Contributor Author

LemonBoy commented Jan 5, 2020

One more thought, how's a cImport user supposed to know the name of the translate-c generated fields?

@daurnimator
Copy link
Contributor

A better solution would be available if either of #985 #1214 were accepted+implemented

@daurnimator daurnimator added the translate-c C to Zig source translation feature (@cImport) label Jan 6, 2020
@andrewrk
Copy link
Member

andrewrk commented Jan 7, 2020

One more thought, how's a cImport user supposed to know the name of the translate-c generated fields?

Good question. This is an area where C has a feature that Zig doesn't have. So it makes sense that it's a bit awkward to try to auto-translate it.

I don't have a good answer to this yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
translate-c C to Zig source translation feature (@cImport)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants