[commit: Cabal] encoding: Windows fixes for Paths module codegen (3159843)

Max Bolingbroke batterseapower at hotmail.com
Wed Apr 6 16:36:57 CEST 2011


Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal

On branch  : encoding

http://hackage.haskell.org/trac/ghc/changeset/31598432089bca5f0b20ee63c695bc25ead260e4

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

commit 31598432089bca5f0b20ee63c695bc25ead260e4
Author: Max Bolingbroke <batterseapower at hotmail.com>
Date:   Tue Apr 5 17:27:59 2011 +0100

    Windows fixes for Paths module codegen

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

 Distribution/Simple/Build/PathsModule.hs |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Distribution/Simple/Build/PathsModule.hs b/Distribution/Simple/Build/PathsModule.hs
index 3419c9c..6e43a9e 100644
--- a/Distribution/Simple/Build/PathsModule.hs
+++ b/Distribution/Simple/Build/PathsModule.hs
@@ -195,7 +195,7 @@ get_prefix_win32 =
   "getPrefixDirRel :: FilePath -> IO FilePath\n"++
   "getPrefixDirRel dirRel = try_size 2048 -- plenty, PATH_MAX is 512 under Win32.\n"++
   "  where\n"++
-  "    try_size size = allocaArray size $ \\buf -> do\n"++
+  "    try_size size = allocaArray (fromIntegral size) $ \\buf -> do\n"++
   "        ret <- c_GetModuleFileName nullPtr buf size\n"++
   "        case ret of\n"++
   "          0 -> return (prefix `joinFileName` dirRel)\n"++
@@ -206,7 +206,7 @@ get_prefix_win32 =
   "            | otherwise  -> try_size (size * 2)\n"++
   "\n"++
   "foreign import stdcall unsafe \"windows.h GetModuleFileNameW\"\n"++
-  "  c_GetModuleFileName :: Ptr () -> CWString -> Int -> IO Int32\n"
+  "  c_GetModuleFileName :: Ptr () -> CWString -> Int32 -> IO Int32\n"
 
 get_prefix_hugs :: String
 get_prefix_hugs =





More information about the Cvs-libraries mailing list