-
Notifications
You must be signed in to change notification settings - Fork 36
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
How to pass struct as argument of function #114
Comments
Hi, maybe it is impossible 🫣 ? Then please tell me about it, then I will not try to make the code work 🕰 |
It's impossible for now... |
oh, that's sad to hear 😔 Thanks for your answer 🤝 |
I also ran into this, trying to wrap a library that has a function that requires a struct passed by value. I could get around it with some type erasure, if only it was shorter -- a void* is 8 bytes and the struct is 16. Is this something that is not supported by libffi, or just not by fiddle? |
It's just not implemented yet. We can do this by using |
Be awesome if this could be implemented in a future version, for real ;) |
Hi, sorry for my english. I will show the problem with examples:
header.h
How its work in ruby with gem ffi
ffi gem works, but sometimes i get segmentation fault :(
So I decided to try to do it with fiddle !
But how ? How to do it with fiddle ? I climbed the entire Internet. I haven't found a single example of how to pass a struct to a function. There are only very few examples of how to pass ordinary primitives and not a single example of how to pass a structure. I have tried many options and still have not been able to achieve a result. Please help me !!! Write an example of calling these functions and passing arguments to them. Really looking forward to the answer.
Here is what I do with fidl:
please help me with this 🙏
The text was updated successfully, but these errors were encountered: