This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
[PATCH 03/13] x86: Force FFI_TYPE_LONGDOUBLE different from FFI_TYPE_DOUBLE
- From: Richard Henderson <rth at twiddle dot net>
- To: libffi-discuss at sourceware dot org
- Date: Fri, 7 Nov 2014 16:30:30 +0100
- Subject: [PATCH 03/13] x86: Force FFI_TYPE_LONGDOUBLE different from FFI_TYPE_DOUBLE
- Authentication-results: sourceware.org; auth=none
- References: <1415374240-1792-1-git-send-email-rth at twiddle dot net>
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 98aa008..339ca89 100644
--- a/src/x86/ffi.c
+++ b/src/x86/ffi.c
@@ -34,6 +34,18 @@
#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;
--
1.9.3