23 result.
a = a1.
a + a2.
a;
24 result.
b = a1.
b + a2.
b;
25 result.
c = a1.
c + a2.
c;
27 printf(
"%d %d %d %d %d %d: %d %d %d\n", a1.
a, a1.
b, a1.
c,
29 result.
a, result.
b, result.
c);
36 void* userdata __UNUSED__)
51 ffi_closure *pcl = ffi_closure_alloc(
sizeof(ffi_closure), &code);
53 ffi_type* cls_struct_fields[4];
54 ffi_type cls_struct_type;
55 ffi_type* dbl_arg_types[5];
61 cls_struct_type.size = 0;
62 cls_struct_type.alignment = 0;
63 cls_struct_type.type = FFI_TYPE_STRUCT;
64 cls_struct_type.elements = cls_struct_fields;
69 cls_struct_fields[3] =
NULL;
71 dbl_arg_types[0] = &cls_struct_type;
72 dbl_arg_types[1] = &cls_struct_type;
73 dbl_arg_types[2] =
NULL;
76 dbl_arg_types) == FFI_OK);
84 printf(
"res: %d %d %d\n", res_dbl.
a, res_dbl.
b, res_dbl.
c);
91 printf(
"res: %d %d %d\n", res_dbl.
a, res_dbl.
b, res_dbl.
c);
cls_struct_3_1byte cls_struct_3_1byte_fn(struct cls_struct_3_1byte a1, struct cls_struct_3_1byte a2)
static void cls_struct_3_1byte_gn(ffi_cif *cif __UNUSED__, void *resp, void **args, void *userdata __UNUSED__)
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_3_1byte cls_struct_3_1byte
ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs, ffi_type *rtype, ffi_type **atypes)