1 Index: libffi/ChangeLog
2 ===================================================================
3 --- libffi.orig/ChangeLog
6 * testsuite/libffi.call/cls_longdouble.c: Likewise.
7 * testsuite/libffi.call/huge_struct.c: Likewise.
9 +2010-08-04 Dan Witte <dwitte@mozilla.com>
11 + * src/x86/ffitarget.h: Add X86_ANY define for all x86/x86_64
13 + * src/x86/ffi.c: Remove redundant ifdef checks.
14 + * src/prep_cif.c: Push stack space computation into src/x86/ffi.c
15 + for X86_ANY so return value space doesn't get added twice.
17 2010-07-22 Dan Witte <dwitte@mozilla.com>
19 * src/*/ffitarget.h: Make FFI_LAST_ABI one past the last valid ABI.
20 Index: libffi/src/prep_cif.c
21 ===================================================================
22 --- libffi.orig/src/prep_cif.c
23 +++ libffi/src/prep_cif.c
24 @@ -110,7 +110,7 @@ ffi_status ffi_prep_cif(ffi_cif *cif, ff
25 FFI_ASSERT_VALID_TYPE(cif->rtype);
27 /* x86, x86-64 and s390 stack space allocation is handled in prep_machdep. */
28 -#if !defined M68K && !defined __i386__ && !defined __x86_64__ && !defined S390 && !defined PA
29 +#if !defined M68K && !defined X86_ANY && !defined S390 && !defined PA
30 /* Make space for the return structure pointer */
31 if (cif->rtype->type == FFI_TYPE_STRUCT
33 @@ -131,7 +131,7 @@ ffi_status ffi_prep_cif(ffi_cif *cif, ff
34 check after the initialization. */
35 FFI_ASSERT_VALID_TYPE(*ptr);
37 -#if !defined __i386__ && !defined __x86_64__ && !defined S390 && !defined PA
38 +#if !defined X86_ANY && !defined S390 && !defined PA
40 if (((*ptr)->type == FFI_TYPE_STRUCT
41 && ((*ptr)->size > 16 || cif->abi != FFI_V9))
42 Index: libffi/src/x86/ffi.c
43 ===================================================================
44 --- libffi.orig/src/x86/ffi.c
45 +++ libffi/src/x86/ffi.c
46 @@ -155,12 +155,10 @@ ffi_status ffi_prep_cif_machdep(ffi_cif
47 switch (cif->rtype->type)
50 -#if defined(X86) || defined (X86_WIN32) || defined(X86_FREEBSD) || defined(X86_DARWIN) || defined(X86_WIN64)
59 Index: libffi/src/x86/ffitarget.h
60 ===================================================================
61 --- libffi.orig/src/x86/ffitarget.h
62 +++ libffi/src/x86/ffitarget.h
65 /* ---- System specific configurations ----------------------------------- */
67 +/* For code common to all platforms on x86 and x86_64. */
70 #if defined (X86_64) && defined (__i386__)
73 @@ -67,16 +70,14 @@ typedef enum ffi_abi {
75 /* TODO: Add fastcall support for the sake of completeness */
76 FFI_DEFAULT_ABI = FFI_SYSV
80 +#elif defined(X86_WIN64)
83 FFI_DEFAULT_ABI = FFI_WIN64
87 /* ---- Intel x86 and AMD x86-64 - */
88 -#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__) || defined(__i386) || defined(__amd64))
90 FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */
92 @@ -86,7 +87,6 @@ typedef enum ffi_abi {
93 FFI_DEFAULT_ABI = FFI_UNIX64
96 -#endif /* X86_WIN64 */