-
Notifications
You must be signed in to change notification settings - Fork 55
Support for ABI-specific integers #261
Support for ABI-specific integers #261
Conversation
@dcharkes This PR currently does not generate or use any ABI-specific integers by default but it's left for the user to do by themselves via the given config. I think it'd better to wait till |
When there's a Dart dev release with it, I can make a dev release for |
I'm currently using the 2.16.0-dev.124 release which I guess supports Abi specific integers. So we can possibly hook up package:ffi in this PR if you want. |
I'll make a pre-release once reviewed: |
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.
Happy new year! 🧨 🎉
LGTM with comments addressed.
I think we should only map int8_t
etc to dart:ffi
types and target typedef
s or AbiSpecificInteger
s in package:ffi
for all other types (including char
, int
, etc.)
@dcharkes I've updated the code to use |
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.
lgtm!
I'll try to get the package:ffi
PR landed soon as well :)
FYI: https://dart-review.googlesource.com/c/sdk/+/228541 We're adding the C types to dart:ffi
in Dart 2.17 (too late for 2.16) so that we can use them in @FfiNative
annotations (which are used in places where we cannot import package:ffi
). I'll update package:ffi
to just export the dart:ffi
definitions when Dart 2.17 comes around.
https://pub.dev/packages/ffi/versions/1.2.0-dev.0/changelog is here! (Note I dropped ssize_t and off_t because they're only part of the posix extension not of C themselves. If we turn out to need these, we can make an extra PR to package:ffi to include some posix types.) |
Closes dart-lang/native#530.
This PR lays the groundwork for the generation of ABI-specific integers.
library-imports
andtype-map
size-map
andtypedef-map
.type-map
can target native types, typedefs, structs and unions.