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

Detect forward declarations and generate opaque enums for them. #62

Closed
emilio opened this issue Sep 22, 2016 · 3 comments
Closed

Detect forward declarations and generate opaque enums for them. #62

emilio opened this issue Sep 22, 2016 · 3 comments

Comments

@emilio
Copy link
Contributor

emilio commented Sep 22, 2016

We should be able to detect forward declarations in bindgen, and generate opaque enums if appropriate, instead of structs with an address byte.

We should check clang_getCursorDefinition() and clang_isCursorDefinition to check whether what we're scanning, mark the generated type accordingly, and do the proper codegen steps.

@fitzgen
Copy link
Member

fitzgen commented Nov 3, 2016

#198 is a dupe of this issue, but for posterity it does include an example with a bit more detail than we have in this issue.

@nikhilshagri
Copy link
Contributor

I'll try this one.

@emilio
Copy link
Contributor Author

emilio commented Dec 24, 2016

Great, let us know if you need anything :)

bors-servo pushed a commit that referenced this issue Jan 26, 2017
Forward declared structs now generate opaque enums

@emilio : I checked the test outputs again, and it seems that these changes are affecting struct *definitions* as well. Hence, I have not committed the test changes yet.
Fixes #62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants