23 result.
a = a1.
a + a2.
a;
24 result.
b = a1.
b + a2.
b;
25 result.
c = a1.
c + a2.
c;
27 printf(
"%d %g %d %d %g %d: %d %g %d\n", a1.
a, a1.
b, a1.
c, a2.
a, a2.
b, a2.
c, result.
a, result.
b, result.
c);
34 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[5];
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;
65 cls_struct_fields[1] = &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 %d\n", res_dbl.
a, res_dbl.
b, res_dbl.
c);
89 printf(
"res: %d %g %d\n", res_dbl.
a, res_dbl.
b, res_dbl.
c);
cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2)
struct cls_struct_align cls_struct_align
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)
static void cls_struct_align_gn(ffi_cif *cif __UNUSED__, void *resp, void **args, void *userdata __UNUSED__)
ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs, ffi_type *rtype, ffi_type **atypes)