Repository : ssh://darcs.haskell.org//srv/darcs/hsc2hs

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/b46ae9e455a4e6766a4dba688c9bc2186056218a

>---------------------------------------------------------------

commit b46ae9e455a4e6766a4dba688c9bc2186056218a
Author: Ian Lynagh <[email protected]>
Date:   Wed May 16 15:15:37 2012 +0100

    Don't use stdcall on Win64: It isn't supported; ccall is used instead

>---------------------------------------------------------------

 Main.hs |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/Main.hs b/Main.hs
index 689997b..9838141 100644
--- a/Main.hs
+++ b/Main.hs
@@ -40,6 +40,16 @@ import DirectCodegen
 import Flags
 import HSCParser
 
+#ifdef mingw32_HOST_OS
+# if defined(i386_HOST_ARCH)
+#  define WINDOWS_CCONV stdcall
+# elif defined(x86_64_HOST_ARCH)
+#  define WINDOWS_CCONV ccall
+# else
+#  error Unknown mingw32 arch
+# endif
+#endif
+
 #ifdef BUILD_NHC
 getDataFileName s = do here <- getCurrentDirectory
                        return (here++"/"++s)
@@ -222,7 +232,7 @@ getExecPath = try_size 2048 -- plenty, PATH_MAX is 512 
under Win32.
           _ | ret < size -> fmap Just $ peekCWString buf
             | otherwise  -> try_size (size * 2)
 
-foreign import stdcall unsafe "windows.h GetModuleFileNameW"
+foreign import WINDOWS_CCONV unsafe "windows.h GetModuleFileNameW"
   c_GetModuleFileName :: Ptr () -> CWString -> Word32 -> IO Word32
 #else
 getExecPath = return Nothing



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to