-
Notifications
You must be signed in to change notification settings - Fork 46
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
Use package:ffigen to generate bindings #15
Comments
@mannprerak2 please take a look at https://github.com/google/webcrypto.dart/tree/use-ffigen-2.
|
I can't seem to see any difference in the fields generated in the diff, could you copy the results from before and after?
Yes depending on the type, you can include/exclude |
My bad, I committed the one that I fixed up manually. It generated them as
I forgot about that! 😅 Done. What about these duplicates? Probably generated because of multiple entry points. webcrypto.dart/lib/src/third_party/boringssl/generated_bindings.dart Lines 3789 to 3811 in b5c7926
I also filed dart-lang/native#395 because many structs reference some other struct that I'm not interested in. It's starting to look quite nice! 😃 |
Ah, that's a bug. Since we use |
I've filled an issue for this dart-lang/native#397. This happened due to forward declarations, which were in the typedef struct cbb_st CBB;
typedef struct cbs_st CBS; This goes away if the structs were excluded and hence only parsed when needed by any function. Other notes: you should consider supplying |
This has no effect for me with a newer Xcode (12.4).
That's because the path to Xcode on my machine is hardcoded in compiler opts. 🙈 |
I've taken a stable at generating the bindings with
package:ffigen
.With dart-lang/native#394 addressed, I can make it work on the host machine.
However, without addressing https://github.com/dart-lang/sdk/issues/36140 and https://github.com/dart-lang/native/issues/530, some of the integer sizes are not generated the right size for cross platform bindings.
Handwritten bindings:
Generated bindings (notice
Uint64
instead ofIntPtr
):Edit: We have a workaround
Experiment: https://github.com/google/webcrypto.dart/tree/use-ffigen (ignore all the code duplication and pointer casts, I just wanted to migrate a single file).
The text was updated successfully, but these errors were encountered: