24 result.
a = a1.
a + a2.
a;
25 result.
b = a1.
b + a2.
b;
26 result.
c = a1.
c + a2.
c;
28 printf(
"%d %g %g %d %g %g: %d %g %g\n", a1.
a, a1.
b, a1.
c, a2.
a, a2.
b, a2.
c,
29 result.
a, result.
b, result.
c);
35 void* userdata __UNUSED__)
49 ffi_closure *pcl = ffi_closure_alloc(
sizeof(ffi_closure), &code);
51 ffi_type* cls_struct_fields[4];
52 ffi_type cls_struct_type;
53 ffi_type* dbl_arg_types[3];
59 cls_struct_type.size = 0;
60 cls_struct_type.alignment = 0;
61 cls_struct_type.type = FFI_TYPE_STRUCT;
62 cls_struct_type.elements = cls_struct_fields;
64 cls_struct_fields[0] = &ffi_type_sint;
65 cls_struct_fields[1] = &ffi_type_double;
66 cls_struct_fields[2] = &ffi_type_double;
67 cls_struct_fields[3] =
NULL;
69 dbl_arg_types[0] = &cls_struct_type;
70 dbl_arg_types[1] = &cls_struct_type;
71 dbl_arg_types[2] =
NULL;
74 dbl_arg_types) == FFI_OK);
82 printf(
"res: %d %g %g\n", res_dbl.
a, res_dbl.
b, res_dbl.
c);
89 printf(
"res: %d %g %g\n", res_dbl.
a, res_dbl.
b, res_dbl.
c);
static void cls_struct_20byte_gn(ffi_cif *cif __UNUSED__, void *resp, void **args, void *userdata __UNUSED__)
struct cls_struct_20byte cls_struct_20byte
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)
cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1, struct cls_struct_20byte a2)
ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs, ffi_type *rtype, ffi_type **atypes)