x86: Force FFI_TYPE_LONGDOUBLE different from FFI_TYPE_DOUBLE
authorRichard Henderson <rth@twiddle.net>
Thu, 30 Oct 2014 20:57:39 +0000 (13:57 -0700)
committerRichard Henderson <rth@twiddle.net>
Wed, 12 Nov 2014 08:15:35 +0000 (09:15 +0100)
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

index 98aa008..339ca89 100644 (file)
 #include <ffi_common.h>
 #include <stdlib.h>
 
+/* 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;