From 3875b6d7726e33275888f6334312d270d65bb77b Mon Sep 17 00:00:00 2001 From: David Daney Date: Fri, 7 Dec 2007 23:21:04 +0000 Subject: [PATCH] ffi.c (ffi_prep_cif_machdep): Handle long double return type. 2007-12-07 David Daney * src/mips/ffi.c (ffi_prep_cif_machdep): Handle long double return type. From-SVN: r130699 --- libffi/ChangeLog | 4 ++++ libffi/src/mips/ffi.c | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libffi/ChangeLog b/libffi/ChangeLog index 3a937c48bed..b23058687fd 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,7 @@ +2007-12-07 David Daney + * src/mips/ffi.c (ffi_prep_cif_machdep): Handle long double return + type. + 2007-12-06 David Daney * include/ffi.h.in (FFI_SIZEOF_JAVA_RAW): Define if not already diff --git a/libffi/src/mips/ffi.c b/libffi/src/mips/ffi.c index cc2a42e7a9f..d0ce201a151 100644 --- a/libffi/src/mips/ffi.c +++ b/libffi/src/mips/ffi.c @@ -462,7 +462,13 @@ ffi_status ffi_prep_cif_machdep(ffi_cif *cif) case FFI_TYPE_DOUBLE: cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 8); break; - + case FFI_TYPE_LONGDOUBLE: + /* Long double is returned as if it were a struct containing + two doubles. */ + cif->flags += FFI_TYPE_STRUCT << (FFI_FLAG_BITS * 8); + cif->flags += (FFI_TYPE_DOUBLE + (FFI_TYPE_DOUBLE << FFI_FLAG_BITS)) + << (4 + (FFI_FLAG_BITS * 8)); + break; default: cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8); break;