public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix IRIX support
@ 2010-02-20 21:54 Jonathan Callen
  2010-02-24 16:00 ` Anthony Green
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Callen @ 2010-02-20 21:54 UTC (permalink / raw)
  To: libffi-discuss; +Cc: Stuart Shelton


[-- Attachment #1.1: Type: text/plain, Size: 315 bytes --]

Attached is a patch to fix IRIX support in libffi.  This patch comes
from the Gentoo bug tracker (rebased against current trunk), and looks
correct, although I did not write it.  The original bug may be viewed at
<https://bugs.gentoo.org/show_bug.cgi?id=286911>.  I have CCed the
original author of the patch.

[-- Attachment #1.2: irix.patch --]
[-- Type: text/plain, Size: 1694 bytes --]

diff --git a/include/ffi.h.in b/include/ffi.h.in
index df7d2cd..6b6de14 100644
--- a/include/ffi.h.in
+++ b/include/ffi.h.in
@@ -254,6 +254,9 @@ size_t ffi_java_raw_size (ffi_cif *cif);
 #ifdef _MSC_VER
 __declspec(align(8))
 #endif
+#ifdef __sgi
+# pragma pack 8
+#endif
 typedef struct {
   char tramp[FFI_TRAMPOLINE_SIZE];
   ffi_cif   *cif;
@@ -263,6 +266,9 @@ typedef struct {
 } ffi_closure __attribute__((aligned (8)));
 #else
 } ffi_closure;
+# ifdef __sgi
+#  pragma pack 0
+# endif
 #endif
 
 void *ffi_closure_alloc (size_t size, void **code);
diff --git a/src/java_raw_api.c b/src/java_raw_api.c
index 9c5383e..522c8bf 100644
--- a/src/java_raw_api.c
+++ b/src/java_raw_api.c
@@ -311,7 +311,7 @@ ffi_java_translate_args (ffi_cif *cif, void *rvalue,
   ffi_raw_closure *cl = (ffi_raw_closure*)user_data;
 
   ffi_java_ptrarray_to_raw (cif, avalue, raw);
-  (*cl->fun) (cif, rvalue, raw, cl->user_data);
+  (*cl->fun) (cif, rvalue, (ffi_raw*)raw, cl->user_data);
   ffi_java_raw_to_rvalue (cif, rvalue);
 }
 
diff --git a/src/mips/ffitarget.h b/src/mips/ffitarget.h
index c5f4e05..3ea9de4 100644
--- a/src/mips/ffitarget.h
+++ b/src/mips/ffitarget.h
@@ -43,7 +43,7 @@
 #  endif
 
 #if !defined(_MIPS_SIM)
--- something is very wrong --
+# error -- something is very wrong --
 #else
 #  if (_MIPS_SIM==_ABIN32 && defined(_ABIN32)) || (_MIPS_SIM==_ABI64 && defined(_ABI64))
 #    define FFI_MIPS_N32
@@ -51,7 +51,7 @@
 #    if (_MIPS_SIM==_ABIO32 && defined(_ABIO32))
 #      define FFI_MIPS_O32
 #    else
--- this is an unsupported platform --
+#     error -- this is an unsupported platform --
 #    endif
 #  endif
 #endif

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-24 19:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-20 21:54 [PATCH] Fix IRIX support Jonathan Callen
2010-02-24 16:00 ` Anthony Green
2010-02-24 19:33   ` Stuart Shelton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).