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

Public fields for derive(WrapperApi) #31

Closed
Vurv78 opened this issue Mar 13, 2021 · 2 comments
Closed

Public fields for derive(WrapperApi) #31

Vurv78 opened this issue Mar 13, 2021 · 2 comments

Comments

@Vurv78
Copy link

Vurv78 commented Mar 13, 2021

Why doesn't the macro allow the fields to be public? Or is there a way I don't know of?

I'm a noob at this stuff, so I don't know if there is a reason or if it just was never implemented. It's super frustrating that this is the only thing holding me back on my project..

@Vurv78
Copy link
Author

Vurv78 commented Mar 14, 2021

Forgot to link where it's not allowed:

_ => panic!("All fields of structures deriving {} need to be private and '{}' is not",

@Vurv78
Copy link
Author

Vurv78 commented Apr 17, 2021

It looks like public fields work fine on my fork. https://github.com/Vurv78/rust-dlopen/tree/future I also took the liberty of making dlopen-derive a feature so you don't need double extern crate / crate imports. Will make a pull request when I fix one thing about the macro exporting.

Edit: Seems I created more problems by changing the file structure, namely the tests and how they get the dll.

Edit 2: Found a reason on my own; rust-lang/rust-bindgen#1937 (comment)

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

Successfully merging a pull request may close this issue.

1 participant