25 result.
a = b0.
a + b1.
a + b2.
a + b3.
a;
26 result.
b = b0.
b + b1.
b + b2.
b + b3.
b;
27 result.
c = b0.
c + b1.
c + b2.
c + b3.
c;
28 result.
d = b0.
d + b1.
d + b2.
d + b3.
d;
30 printf(
"%g %g %d %g %g %g %d %g %g %g %d %g %g %g %d %g: %g %g %d %g\n",
31 b0.
a, b0.
b, b0.
c, b0.
d,
32 b1.
a, b1.
b, b1.
c, b1.
d,
33 b2.
a, b2.
b, b2.
c, b2.
d,
34 b3.
a, b3.
b, b3.
c, b2.
d,
35 result.
a, result.
b, result.
c, result.
d);
42 void* userdata __UNUSED__)
58 ffi_closure *pcl = ffi_closure_alloc(
sizeof(ffi_closure), &code);
60 ffi_type* cls_struct_fields[5];
61 ffi_type cls_struct_type;
62 ffi_type* dbl_arg_types[5];
70 cls_struct_type.size = 0;
71 cls_struct_type.alignment = 0;
72 cls_struct_type.type = FFI_TYPE_STRUCT;
73 cls_struct_type.elements = cls_struct_fields;
75 cls_struct_fields[0] = &ffi_type_double;
76 cls_struct_fields[1] = &ffi_type_double;
77 cls_struct_fields[2] = &ffi_type_sint;
78 cls_struct_fields[3] = &ffi_type_float;
79 cls_struct_fields[4] =
NULL;
81 dbl_arg_types[0] = &cls_struct_type;
82 dbl_arg_types[1] = &cls_struct_type;
83 dbl_arg_types[2] = &cls_struct_type;
84 dbl_arg_types[3] = &cls_struct_type;
85 dbl_arg_types[4] =
NULL;
88 dbl_arg_types) == FFI_OK);
98 printf(
"res: %g %g %d %g\n", res_dbl.
a, res_dbl.
b, res_dbl.
c, res_dbl.
d);
107 (code))(e_dbl, f_dbl, g_dbl, h_dbl);
109 printf(
"res: %g %g %d %g\n", res_dbl.
a, res_dbl.
b, res_dbl.
c, res_dbl.
d);
static void cls_struct_24byte_gn(ffi_cif *cif __UNUSED__, void *resp, void **args, void *userdata __UNUSED__)
cls_struct_24byte cls_struct_24byte_fn(struct cls_struct_24byte b0, struct cls_struct_24byte b1, struct cls_struct_24byte b2, struct cls_struct_24byte b3)
ffi_status ffi_prep_closure_loc(ffi_closure *closure, ffi_cif *cif, void(*fun)(ffi_cif *, void *, void **, void *), void *user_data, void *codeloc)
void ffi_call(ffi_cif *cif, void(*fn)(void), void *rvalue, void **avalue)
struct cls_struct_24byte cls_struct_24byte
ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs, ffi_type *rtype, ffi_type **atypes)