changeset 134:59d758760688

- mips o32 callback fixes for big endian platforms
author cslag
date Thu, 14 Jul 2016 16:05:24 +0200
parents 089df1eee6d0
children fcbec299b736
files dyncall/dyncall_value.h
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dyncall/dyncall_value.h	Thu Jul 14 14:41:32 2016 +0200
+++ b/dyncall/dyncall_value.h	Thu Jul 14 16:05:24 2016 +0200
@@ -50,7 +50,7 @@
 {
 /* dyncallback assembly pulls value directly from DCValue structs, without   */
 /* knowledge about types used, so lay it out as needed at compile time, here */
-#if (defined(DC__Arch_PPC32) || defined(DC__Arch_MIPS)) && defined(DC__Endian_BIG)
+#if defined(DC__Endian_BIG) && (defined(DC__Arch_PPC32) || defined(DC__Arch_MIPS))
   DCbool      B;
   struct { DCchar  c_pad[3]; DCchar  c; };
   struct { DCuchar C_pad[3]; DCuchar C; };
@@ -58,7 +58,7 @@
   struct { DCshort S_pad;    DCshort S; };
   DCint       i;
   DCuint      I;
-#elif (defined(DC__Arch_PPC64) || defined(DC__Arch_MIPS64)) && defined(DC__Endian_BIG)
+#elif defined(DC__Endian_BIG) && (defined(DC__Arch_PPC64) || defined(DC__Arch_MIPS64))
   struct { DCbool  B_pad;    DCbool  B; };
   struct { DCchar  c_pad[7]; DCchar  c; };
   struct { DCuchar C_pad[7]; DCuchar C; };
@@ -79,7 +79,8 @@
   DCulong     J;
   DClonglong  l;
   DCulonglong L;
-#if defined(DC__Arch_MIPS64) && defined(DC__Endian_BIG)
+/* floats on mips are right justified in fp-registers on big endian targets, as they aren't promoted */
+#if defined(DC__Endian_BIG) && (defined(DC__Arch_MIPS) || defined(DC__Arch_MIPS64))
   struct { DCfloat f_pad; DCfloat f; };
 #else
   DCfloat     f;