diff dyncall/dyncall_value.h @ 126:be08b699dca5

- mips64 n64 float fixes (big endian), now mips64 n64 is fully supported (for at least big-endian platforms, still need to test little endian)
author cslag
date Tue, 05 Jul 2016 14:20:57 +0200
parents 6bd0974d257b
children 59d758760688
line wrap: on
line diff
--- a/dyncall/dyncall_value.h	Tue Jul 05 14:15:56 2016 +0200
+++ b/dyncall/dyncall_value.h	Tue Jul 05 14:20:57 2016 +0200
@@ -48,14 +48,16 @@
 
 union DCValue_
 {
+/* 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)
-  DCbool        B;
+  DCbool      B;
   struct { DCchar  c_pad[3]; DCchar  c; };
   struct { DCuchar C_pad[3]; DCuchar C; };
   struct { DCshort s_pad;    DCshort s; };
   struct { DCshort S_pad;    DCshort S; };
-  DCint         i;
-  DCuint        I;
+  DCint       i;
+  DCuint      I;
 #elif (defined(DC__Arch_PPC64) || defined(DC__Arch_MIPS64)) && defined(DC__Endian_BIG)
   struct { DCbool  B_pad;    DCbool  B; };
   struct { DCchar  c_pad[7]; DCchar  c; };
@@ -65,22 +67,26 @@
   struct { DCint   i_pad;    DCint   i; };
   struct { DCint   I_pad;    DCuint  I; };
 #else
-  DCbool        B;
-  DCchar        c;
-  DCuchar       C;
-  DCshort       s;
-  DCushort      S;
-  DCint         i;
-  DCuint        I;
+  DCbool      B;
+  DCchar      c;
+  DCuchar     C;
+  DCshort     s;
+  DCushort    S;
+  DCint       i;
+  DCuint      I;
 #endif
-  DClong        j;
-  DCulong       J;
-  DClonglong    l;
-  DCulonglong   L;
-  DCfloat       f;
-  DCdouble      d;
-  DCpointer     p;
-  DCstring      Z;
+  DClong      j;
+  DCulong     J;
+  DClonglong  l;
+  DCulonglong L;
+#if defined(DC__Arch_MIPS64) && defined(DC__Endian_BIG)
+  struct { DCfloat f_pad; DCfloat f; };
+#else
+  DCfloat     f;
+#endif
+  DCdouble    d;
+  DCpointer   p;
+  DCstring    Z;
 };
 
 #ifdef __cplusplus