-
Notifications
You must be signed in to change notification settings - Fork 719
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
Field visibility callback #2525
Conversation
182699e
to
2c591b8
Compare
Hi @jethrogb thank you for this PR. Could you please add a couple of tests showing the interaction of this work with the flag |
3c4174b
to
73cd7e7
Compare
I assume you mean I'm not sure what you mean by “that should take precedence and showing it does not break”, the callback takes precendence over whatever is inferred from the type, just like the annotations already do. I've added some tests in private_fields.hpp. |
73cd7e7
to
d396af3
Compare
Hmmm... Right now
I'm more inclined towards the first option but I'd be happy to hear an argument about any other option in any case. |
As is apparent from af66f4a, and as I explained in my comment, the behavior of overriding respect-cxx-access-specs is already there. |
Oh OK I missed the annotations part. Yes, so this feature has the same precedence as the annotations. My question is if that's desirable or not because it somehow feels "wrong" to enable You could argue that annotations also ignore this but at least annotations are part of the input taken by I'm not saying this reason is strong enough but it should be properly stated that anyone using this callback when I'll review the actual code in a bit and give you a proper review. Just wanted to clarify this point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome! I requested some small changes but the core logic looks great. Could you also document all these changes in the changelog? Thanks
d396af3
to
cc966e4
Compare
I've made the requested changes.
People generally use these callbacks as a "last resort" when they find bindgen doesn't quite do what they wanted. As such I think it's correct to override the more generic mechanism. |
cc966e4
to
d10809d
Compare
Hey! the test suite broke due to an unrelated issue that has already been fixed in the main branch, could you rebase your PR against it so we can be sure the tests are passing? |
d10809d
to
fbd3737
Compare
fbd3737
to
b69b1f0
Compare
Add a callback mechanism for determining field visibility. This PR includes 2 other related (breaking) behavior changes in the prior commits: