-
Notifications
You must be signed in to change notification settings - Fork 327
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
Support shared struct with C++ source of truth #871
Comments
If you're feeling bold, you can try autocxx and specifically generate_pod!, which should do what you want. |
Unfortunately, the C++ code I'm trying to interface with is too complicated for autocxx/bindgen to process cleanly at the moment, so while I'd love to use autocxx, it's not possible quite yet. It's worth noting that you can already do exactly this, just without the checks that your mapping is correct. It would be nice to extend the checks for extern shared enums to extern shared structs. |
If you get a chance, it'd be great if you could file an autocxx bug per these instructions. In particular if you can run the codegen with The general state of play is that it can cope with any codebase right now, so long as you are specific about bindings what you want to generate using |
Reported google/autocxx#479. Unfortunately the code isn't reproducible but it is freely obtainable, so perhaps someone able to track down where autocxx is panicking can reproduce the panic and minimize the issue. |
I want to be able to write the following or equivalent:
and it have it expand to the the following or equivalent:
This uses only C++11 functionality as written. The only member types supported would be primitive types or (potentially) shared types defined in the same bridge module. This requires knowledge of the
repr(C)
layout algorithm to assert that it is correct; for this use case we can use the simple definition:For extra paranoia we could also emit assertions that our understanding is correct on the Rust side as well.
Preprocessor macros to make doing so manually easier
The text was updated successfully, but these errors were encountered: