Re: Preliminary libffi progress
- Posted by Icy_Viking Sep 25, 2022
- 1555 views
ghaberek said...
Icy_Viking said...
Is there a link where we can see the code to libffi.e so far?
I need to clean it up a bit and then I'll push it to GitHub and share the link. Keep in mind that this is a temporary approach and ultimately libffi would be compiled into the backend and then exposed using machine_func().
Edit: putting together some rough documentation, I came up with this feature comparison table:
Feature | std/dll.e | std/ffi.e |
---|---|---|
Define C variables | YES | YES |
Define C functions | YES | YES |
Define machine functions | YES | YES |
STDCALL convention | YES | YES |
CDECL convention | YES | YES |
FASTCALL convention | NO | YES |
PASCAL convention | NO | YES |
THISCALL convention | NO | YES |
Pass structures by value | NO | YES |
Receive structures by value | NO | YES |
Variable-length call-backs | NO | YES |
Floating-point call-backs | NO | YES |
-Greg
This is looking great so far Greg, even if its in the early stages. I think this will really help in wrapping libraries. Making it much easier to wrap libraries and not have to make shim libraries or declaring structs as separate entities.