$NetBSD: patch-bg,v 1.1.1.1 2011/04/19 11:16:08 tnn Exp $ --- js/ctypes/libffi/src/mips/ffi.c.orig 2010-03-31 08:23:20.000000000 -0400 +++ js/ctypes/libffi/src/mips/ffi.c 2010-03-31 08:25:28.000000000 -0400 @@ -32,12 +32,19 @@ #ifdef __GNUC__ # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) -# define USE__BUILTIN___CLEAR_CACHE 1 +# if !defined(__NetBSD__) +# define USE__BUILTIN___CLEAR_CACHE 1 +# endif # endif #endif #ifndef USE__BUILTIN___CLEAR_CACHE -#include +# if !defined(__NetBSD__) +# include +# else +# include +# define cacheflush _cacheflush +# endif #endif #ifdef FFI_DEBUG @@ -419,6 +426,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif ((cif->arg_types)[index]->type << (arg_reg * FFI_FLAG_BITS)); arg_reg++; break; +#ifdef __mips64 case FFI_TYPE_LONGDOUBLE: /* Align it. */ arg_reg = ALIGN(arg_reg, 2); @@ -430,6 +438,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif (FFI_TYPE_DOUBLE << (arg_reg * FFI_FLAG_BITS)); arg_reg++; break; +#endif case FFI_TYPE_STRUCT: loc = arg_reg * FFI_SIZEOF_ARG; @@ -474,6 +483,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif case FFI_TYPE_DOUBLE: cif->flags += cif->rtype->type << (FFI_FLAG_BITS * 8); break; +#ifdef __mips64 case FFI_TYPE_LONGDOUBLE: /* Long double is returned as if it were a struct containing two doubles. */ @@ -481,6 +491,7 @@ ffi_status ffi_prep_cif_machdep(ffi_cif cif->flags += (FFI_TYPE_DOUBLE + (FFI_TYPE_DOUBLE << FFI_FLAG_BITS)) << (4 + (FFI_FLAG_BITS * 8)); break; +#endif default: cif->flags += FFI_TYPE_INT << (FFI_FLAG_BITS * 8); break;