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

Handle function parameters that match zig keywords #31

Open
Srekel opened this issue Oct 12, 2024 · 2 comments
Open

Handle function parameters that match zig keywords #31

Srekel opened this issue Oct 12, 2024 · 2 comments

Comments

@Srekel
Copy link
Contributor

Srekel commented Oct 12, 2024

Upon binding The-Forge, we found a case where it has a function with a parameter called align. This causes a compile error because align is also a Zig keyword. c2z should replace it with @"align".

I believe this is done in one or two other places so hopefully should be a function call that's needed somewhere. :)

@Srekel
Copy link
Contributor Author

Srekel commented Oct 12, 2024

Related, it seems to use @"lol" unnecessarily when generating the pub extern fn lol names. I don't think this was always the case?

@lassade
Copy link
Owner

lassade commented Oct 17, 2024

Yes, this is because, of the no-glue option it avoids generating the c++ glue, but it will be target specific and add use mangled function names these can be something like "?foo@@YAXHD@Z".

the @"" used to be removed during formatting ...

Also I have a function keywordFix that isn't been used, but maybe just decorating names with @"" will be better

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

No branches or pull requests

2 participants