This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
[patch] libffii, fix build for powerpc where DOUBLE equal LONGDOUBLE
- From: Andreas Tobler <andreast-list at fgznet dot ch>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, libffi-discuss at sourceware dot org
- Date: Sat, 02 Feb 2013 17:36:26 +0100
- Subject: [patch] libffii, fix build for powerpc where DOUBLE equal LONGDOUBLE
Hi,
I'm going to apply the patch below if there are no objections.
On PowerPC FreeBSD we have DOUBLE = LONGDOUBLE, so w/o the below the
compilation fails with a double 'case' entry.
Something went wrong with the latest upstream patch. And I didn't have a
chance to test earlier.
Ok?
TIA,
Andreas
2013-02-02 Andreas Tobler <andreast@fgznet.ch>
* src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix case where
DOUBLE equal LONGDOUBLE.
Index: src/powerpc/ffi.c
===================================================================
--- src/powerpc/ffi.c (revision 195611)
+++ src/powerpc/ffi.c (working copy)
@@ -664,9 +664,11 @@
switch (type)
{
#ifndef __NO_FPRS__
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
case FFI_TYPE_LONGDOUBLE:
flags |= FLAG_RETURNS_128BITS;
/* Fall through. */
+#endif
case FFI_TYPE_DOUBLE:
flags |= FLAG_RETURNS_64BITS;
/* Fall through. */