This repository was archived by the owner on Jan 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Allow Utf8 usage without cast #6
Comments
@vaind Can you please share the code where you call |
Does this diff help? It was an attempt to get rid of the casts. |
I checked out your code but I couldn't find the |
The reverse function from the description of this comment is from the dart FFI example repo linked in the original post. We're not using that function, I just referred to it hoping you'd be aware of it and it would be easier to understand than talking about our actual code (as linked in the previous comment). The whole thing is not about that specific function but about being able to use |
This is now possible with ffi 0.1.3 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This example seemed to allow passing to C and reading from C without casts, by defining an FFI function as follows:
That doesn't work with the current version of the
Utf8.toUtf8
andfromUtf8
. It's necessary to usePointer<Uint8>
in the function definition with as well as appropriate casts when calling/receiving. The error when using the signature as above isError: Expected type 'Pointer<Utf8> Function()' to be 'Pointer<Uint8> Function()'
As this is repeated in all the calls, it would be nice if we could get rid of the casts altogether (which seemed to have worked in the given example).
The difference seems to be
The text was updated successfully, but these errors were encountered: