diff options
Diffstat (limited to 'ext/ffi_c/libffi/testsuite/libffi.call/struct7.c')
-rw-r--r-- | ext/ffi_c/libffi/testsuite/libffi.call/struct7.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c b/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c index 58aac4c..badc7e0 100644 --- a/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c +++ b/ext/ffi_c/libffi/testsuite/libffi.call/struct7.c @@ -13,7 +13,7 @@ typedef struct double d; } test_structure_7; -static test_structure_7 struct7 (test_structure_7 ts) +static test_structure_7 ABI_ATTR struct7 (test_structure_7 ts) { ts.f1 += 1; ts.f2 += 1; @@ -29,6 +29,13 @@ int main (void) void *values[MAX_ARGS]; ffi_type ts7_type; ffi_type *ts7_type_elements[4]; + + test_structure_7 ts7_arg; + + /* This is a hack to get a properly aligned result buffer */ + test_structure_7 *ts7_result = + (test_structure_7 *) malloc (sizeof(test_structure_7)); + ts7_type.size = 0; ts7_type.alignment = 0; ts7_type.type = FFI_TYPE_STRUCT; @@ -38,18 +45,11 @@ int main (void) ts7_type_elements[2] = &ffi_type_double; ts7_type_elements[3] = NULL; - - test_structure_7 ts7_arg; - - /* This is a hack to get a properly aligned result buffer */ - test_structure_7 *ts7_result = - (test_structure_7 *) malloc (sizeof(test_structure_7)); - args[0] = &ts7_type; values[0] = &ts7_arg; /* Initialize the cif */ - CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts7_type, args) == FFI_OK); + CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts7_type, args) == FFI_OK); ts7_arg.f1 = 5.55f; ts7_arg.f2 = 55.5f; |