MERGE from 6.6: Windows fix for stdcall foreign-import-wrapper, fixes ffi012(ghci)
authorSimon Marlow <simonmar@microsoft.com>
Wed, 21 Feb 2007 09:29:50 +0000 (09:29 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Wed, 21 Feb 2007 09:29:50 +0000 (09:29 +0000)
compiler/ghci/ByteCodeAsm.lhs

index f1f5c8a..1491f55 100644 (file)
@@ -370,6 +370,12 @@ mkBits findLabel st proto_insns
           = do st_I1 <- addToSS st_I0 (getName dcon)
                return (sizeSS st_I0, (st_i0,st_l0,st_p0,st_I1))
 
+#ifdef mingw32_TARGET_OS
+       literal st (MachLabel fs (Just sz)) 
+            = litlabel st (appendFS fs (mkFastString ('@':show sz)))
+        -- On Windows, stdcall labels have a suffix indicating the no. of 
+        -- arg words, e.g. foo@8.  testcase: ffi012(ghci)
+#endif
        literal st (MachLabel fs _) = litlabel st fs
        literal st (MachWord w)     = int st (fromIntegral w)
        literal st (MachInt j)      = int st (fromIntegral j)