in my FFI code, I need to sure that ffi_prep_cif went ok, so I added this:
Code: Select all
status = ffi_prep_cif(&cif,FFI_DEFAULT_ABI,2,&ffi_type_uint,argt);
if(status != FFI_OK)
{
return(errorProcExt2(ERR_FFI_PREP_FAILED, stuffString(ffi->name)));
}
else
{
ffi_call(&cif,ffi->func,&result,aval);
}
If I now try this newLisp snippet:
Code: Select all
(import "msvcrt" "printf" "cdecl")
(fcall printf a b c)
(exit 0)
Last message is (after adding additional messages and error numbers):
ERR: ffi preparation failed in function fcall : "printf"
As said, the newLisp.exe crashes.
It doesn't matter, at which point I call errorProcExt2, even right after entering the function.