10static double return_dbl(
double dbl)
22 args[0] = &ffi_type_double;
27 &ffi_type_double, args) == FFI_OK);
29 for (dbl = -127.3; dbl < 127; dbl++)
31 ffi_call(&cif, FFI_FN(return_dbl), &rdbl, values);
32 printf (
"%f vs %f\n", rdbl, return_dbl(dbl));
33 CHECK(rdbl == 2 * dbl);
void ffi_call(ffi_cif *cif, void(*fn)(void), void *rvalue, void **avalue)
ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs, ffi_type *rtype, ffi_type **atypes)