summaryrefslogtreecommitdiff
path: root/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/ffi_c/libffi/testsuite/libffi.call/struct3.c')
-rw-r--r--ext/ffi_c/libffi/testsuite/libffi.call/struct3.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c b/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c
index e0bb09b..7eba0ea 100644
--- a/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c
+++ b/ext/ffi_c/libffi/testsuite/libffi.call/struct3.c
@@ -12,7 +12,7 @@ typedef struct
int si;
} test_structure_3;
-static test_structure_3 struct3(test_structure_3 ts)
+static test_structure_3 ABI_ATTR struct3(test_structure_3 ts)
{
ts.si = -(ts.si*2);
@@ -27,6 +27,11 @@ int main (void)
int compare_value;
ffi_type ts3_type;
ffi_type *ts3_type_elements[2];
+
+ test_structure_3 ts3_arg;
+ test_structure_3 *ts3_result =
+ (test_structure_3 *) malloc (sizeof(test_structure_3));
+
ts3_type.size = 0;
ts3_type.alignment = 0;
ts3_type.type = FFI_TYPE_STRUCT;
@@ -34,15 +39,11 @@ int main (void)
ts3_type_elements[0] = &ffi_type_sint;
ts3_type_elements[1] = NULL;
- test_structure_3 ts3_arg;
- test_structure_3 *ts3_result =
- (test_structure_3 *) malloc (sizeof(test_structure_3));
-
args[0] = &ts3_type;
values[0] = &ts3_arg;
/* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ CHECK(ffi_prep_cif(&cif, ABI_NUM, 1,
&ts3_type, args) == FFI_OK);
ts3_arg.si = -123;