callbacks with primitive types #337
Replies: 3 comments 1 reply
-
Have you tried using Structs by value are not yet supported, see #14 |
Beta Was this translation helpful? Give feedback.
-
[I actually tried that first.] |
Beta Was this translation helpful? Give feedback.
-
Output looks like:
The first two caveman debugging lines come from over on the C side. I maybe should mention that |
Beta Was this translation helpful? Give feedback.
-
I have a C function with a signature like this:
On the Java side, I tried:
And use it:
I get a garbage value in the Double. I also tried making the arg double instead of Double the delegate. Same result.
I also tried changing the C signature to double* and the Java side to Pointer and unpacking with Pointer.getDouble(0). This matches the only callback examples I've found on the interwebs, and works. But how to I interop with a native interface that is not pointers but instead passes literals by value or (let's say) structs by value?
Beta Was this translation helpful? Give feedback.
All reactions