10static void cls_ret_float_fn(ffi_cif* cif
__UNUSED__,
void* resp,
void** args,
13 *(
float *)resp = *(
float *)args[0];
15 printf(
"%g: %g\n",*(
float *)args[0],
25 ffi_closure *pcl = ffi_closure_alloc(
sizeof(ffi_closure), &code);
26 ffi_type * cl_arg_types[2];
29 cl_arg_types[0] = &ffi_type_float;
30 cl_arg_types[1] =
NULL;
34 &ffi_type_float, cl_arg_types) == FFI_OK);
39 printf(
"res: %.6f\n", res);
ffi_status ffi_prep_closure_loc(ffi_closure *closure, ffi_cif *cif, void(*fun)(ffi_cif *, void *, void **, void *), void *user_data, void *codeloc)
float(* cls_ret_float)(float)
ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs, ffi_type *rtype, ffi_type **atypes)