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

Typedef support #359

Closed
TimWhiting opened this issue May 19, 2021 · 4 comments · Fixed by dart-archive/ffigen#224
Closed

Typedef support #359

TimWhiting opened this issue May 19, 2021 · 4 comments · Fixed by dart-archive/ffigen#224

Comments

@TimWhiting
Copy link

Now that Dart 2.13 has non-function typedef support I think it would be reasonable to translate C typedefs to Dart typedefs. In a library I'm attempting to wrap it has a lot of simple typedefs, which makes it hard when I'm trying to find some type under a certain name as specified in the headers, only to find it has a different name in the dart library generated by ffigen.

@mannprerak2
Copy link
Contributor

Yes, this would be a good feature, especially when structs have multiple names. We should still probably only generate typedefs that are being used somewhere in the generated code.

@TimWhiting
Copy link
Author

I think that only generating typedefs that are being used somewhere is a good default, but the option to include all typedefs should be available.

@mannprerak2
Copy link
Contributor

mannprerak2 commented May 21, 2021

From what I see, having typedefs that aren't being used anywhere in the generated bindings would be useless, even if generated.

Can you point out some use cases for when this would be helpful? Otherwise simply generating only the required typedefs would be much simpler.

@TimWhiting
Copy link
Author

I guess you are right. I can't think of a situation where that would be useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants