Re: Preliminary libffi progress
- Posted by Icy_Viking Sep 27, 2022
- 1503 views
If you wish to compare, here is a version without libffi that can run the core_basic_windows.ex demo:
It looks like you're allocating the structures to memory and then passing the pointer around. Raylib is passing structures by value. Does this work? Have you tried it with Raylib? Are you using 32-bit or 64-bit Euphoria?
When running the 32-bit version, I get the following error:
ffi.e:775 in function define_c_func() ffi_prep_cif() returned FFI_BAD_ABI (2)
The 64-bit version doesn't show any errors, but doesn't run, I assume due to not having a 64-bit installtion of Euphoria, which I need to do.
I'll be honest: I didn't test the 32-bit version at all. I try not to use 32-bit anymore.
My guess is that FFI_MS_CDECL isn't the correct calling convention for what I'm trying to do, or there's something else I'm missing here.
Could you provide the full back trace from ex.err? Just the "called from" lines so I know which define_c_func() call triggered this.
-Greg
Hey Greg. Here is the called from lines from ex.err
ffi.e:775 in function define_c_func() ffi_prep_cif() returned FFI_BAD_ABI (2) lib = 1710096384 name = {73'I',110'n',105'i',116't',87'W',105'i',110'n',100'd',111'o', 119'w'} arg_types = {1795457132,1795457132,12319936} rtype = 1795457204 abi = 8 fn = 1710416016 pname = 44806000 parg_types = 44806080 nargs = 3 cif = 44806000 status = 2 \ffi.e:784 in function define_c_proc() lib = 1710096384 name = {43'+',73'I',110'n',105'i',116't',87'W',105'i',110'n',100'd',111'o', 119'w'} arg_types = {1795457132,1795457132,12319936} called from:..... raylib.e:311
I can send the full ex.err if needed.