From e7b0056d60f29675072454a575eed98053fc63d6 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 30 Oct 2014 13:57:39 -0700 Subject: [PATCH] x86: Force FFI_TYPE_LONGDOUBLE different from FFI_TYPE_DOUBLE There are few abis that set double = long double. Eliminate the conditional compilation and let this code simply be unused there. --- src/x86/ffi.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/x86/ffi.c b/src/x86/ffi.c index 98aa0085..339ca892 100644 --- a/src/x86/ffi.c +++ b/src/x86/ffi.c @@ -34,6 +34,18 @@ #include #include +/* Force FFI_TYPE_LONGDOUBLE to be different than FFI_TYPE_DOUBLE; + all further uses in this file will refer to the 80-bit type. */ +#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +# if FFI_TYPE_LONGDOUBLE != 4 +# error FFI_TYPE_LONGDOUBLE out of date +# endif +#else +# undef FFI_TYPE_LONGDOUBLE +# define FFI_TYPE_LONGDOUBLE 4 +#endif + + /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ @@ -205,9 +217,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) case FFI_TYPE_SINT64: case FFI_TYPE_FLOAT: case FFI_TYPE_DOUBLE: -#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE case FFI_TYPE_LONGDOUBLE: -#endif cif->flags = (unsigned) cif->rtype->type; break;