Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/c01a23d3e8ad3c9bd3a6fa864ec3d2c8f593906d >--------------------------------------------------------------- commit c01a23d3e8ad3c9bd3a6fa864ec3d2c8f593906d Author: Max Bolingbroke <[email protected]> Date: Fri Nov 18 17:49:04 2011 +0000 Update for a mutable localeEncoding >--------------------------------------------------------------- compiler/ghci/ObjLink.lhs | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/compiler/ghci/ObjLink.lhs b/compiler/ghci/ObjLink.lhs index ea644b9..f467c7a 100644 --- a/compiler/ghci/ObjLink.lhs +++ b/compiler/ghci/ObjLink.lhs @@ -36,7 +36,11 @@ import Control.Monad ( when ) import Foreign.C import Foreign ( nullPtr ) import GHC.Exts ( Ptr(..) ) -import GHC.IO.Encoding ( fileSystemEncoding ) +#if __GLASGOW_HASKELL__ >= 703 +import GHC.IO.Encoding (getFileSystemEncoding) +#else +import GHC.IO.Encoding (TextEncoding, fileSystemEncoding) +#endif import qualified GHC.Foreign as GHC import System.FilePath ( dropExtension ) @@ -45,9 +49,16 @@ import System.FilePath ( dropExtension ) -- RTS Linker Interface -- --------------------------------------------------------------------------- +#if __GLASGOW_HASKELL__ < 703 +getFileSystemEncoding :: IO TextEncoding +getFileSystemEncoding = return fileSystemEncoding +#endif + -- UNICODE FIXME: Unicode object/archive/DLL file names on Windows will only work in the right code page withFileCString :: FilePath -> (CString -> IO a) -> IO a -withFileCString = GHC.withCString fileSystemEncoding +withFileCString fp f = do + enc <- getFileSystemEncoding + GHC.withCString enc fp f insertSymbol :: String -> String -> Ptr a -> IO () insertSymbol obj_name key symbol _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
