-
Notifications
You must be signed in to change notification settings - Fork 68
[ffigen] Generate TypedLists for Pointer arguments if leaf functions #874
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
Comments
For my purposes I would want all TypedList arguments to be automatically unwrapped to pointers for the native call. Typically it looks like:
|
Could we do something where we mark up arguments in the header file?
|
should the yaml field be prefixed with |
So far we have not elected to have configuration in the header files, because in many projects the author does not own the C header file. Regarding configuration, we're considering moving away from YAML and having a Dart API instead. But that's a bit of a longer term project. For now lets just stick with the YAML style we already have.
sgtm |
With the new API, this is no longer needed. The |
It would be nice if ffigen supported generating the code for unwrapping leaf functions. Unless I missed something I have to manually call LookupFunction with the correct type arguments.
Originally posted by @johnmccutchan in dart-lang/sdk#54465 (comment)
@johnmccutchan Would you like all arguments to be typed data? This should probably be some regex match so that one can pick and choose which functions. If we want to take it really far one might want to configure it per argument even.
Matching functions in
use-typed-data
that are not leaf is a no-op or an error.Only arguments are typed data, return types are not.
The only types that can be unwrapped are:
int8_t
int16_t
int32_t
int64_t
uint8_t
uint16_t
uint32_t
uint64_t
float
double
Abi-specific integers are not supported.
The text was updated successfully, but these errors were encountered: