13static long double ldblit(
float f)
15 return (
long double) (((
long double)
f)/ (
long double) 3.0);
26 args[0] = &ffi_type_float;
31 &ffi_type_longdouble, args) == FFI_OK);
39 printf (
"%Lf\n", ldblit(
f));
42 ffi_call(&cif, FFI_FN(ldblit), &ld, values);
48 printf (
"%Lf, %Lf, %Lf, %Lf\n", ld, ldblit(
f), ld - ldblit(
f), LDBL_EPSILON);
52 if (ld - ldblit(
f) < LDBL_EPSILON)
53 puts(
"long double return value tests ok!");
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)