changeset 730:09b88beffd2d

Enable arg reversal on x86 by default. Make change to TypeInfo_Struct.compare to accomodate for it.
author Christian Kamm <kamm incasoftware de>
date Sun, 26 Oct 2008 21:16:21 +0100
parents 50d01791859c
children d63741d00ee3
files premake.lua runtime/internal/genobj.d
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/premake.lua	Sun Oct 26 17:31:05 2008 +0100
+++ b/premake.lua	Sun Oct 26 21:16:21 2008 +0100
@@ -38,8 +38,8 @@
 io.write("Default target: '"..TRIPLE.."'\n");
 
 -- x86 ABI support
-X86_REVERSE_PARAMS = 0 --disabled for now
-X86_PASS_IN_EAX = 0
+X86_REVERSE_PARAMS = 1
+X86_PASS_IN_EAX = 0 --disabled for now
 
 -- D version - don't change these !!!
 DMDV1 = "1"
--- a/runtime/internal/genobj.d	Sun Oct 26 17:31:05 2008 +0100
+++ b/runtime/internal/genobj.d	Sun Oct 26 21:16:21 2008 +0100
@@ -800,7 +800,11 @@
             {   if (!p2)
                     c = 1;
                 else if (xopCmp)
-                    c = (*xopCmp)(p1, p2);
+		    // the x86 D calling conv requires the this arg to be last here
+		    version(X86)
+                        c = (*xopCmp)(p2, p1);
+		    else
+		        c = (*xopCmp)(p1, p2);
                 else
                     // BUG: relies on the GC not moving objects
                     c = memcmp(p1, p2, m_init.length);