T
Thorsten Hater
Hello,
I'm playing around with FFI and encountered a problem, I could not solve
till now.
Let's assume I use standard C's malloc in my wrapper:
attach_function :malloc, [:int], ointer
so far no problem. But what now? The pointer returned is of type void*,
which is of no help, since I need double*, int* and float* ...
Is there a type cast mechanism in FFI (or anything similar) or do I have
to wrap
the original library in another layer of C (alternatively write a helper
lib...)
Or can I import C's typecasts using FFI itself?
Best regards,
Thorsten
I'm playing around with FFI and encountered a problem, I could not solve
till now.
Let's assume I use standard C's malloc in my wrapper:
attach_function :malloc, [:int], ointer
so far no problem. But what now? The pointer returned is of type void*,
which is of no help, since I need double*, int* and float* ...
Is there a type cast mechanism in FFI (or anything similar) or do I have
to wrap
the original library in another layer of C (alternatively write a helper
lib...)
Or can I import C's typecasts using FFI itself?
Best regards,
Thorsten