diff options
author | Simon Marlow <marlowsd@gmail.com> | 2009-05-29 13:18:22 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2009-05-29 13:18:22 +0000 |
commit | 1c83695b5b9ae3175c18908c1d58aeadb1f225ae (patch) | |
tree | 31d3073656ae76ac32d0a4819c9bbfc6bd82ecd6 /ghc | |
parent | 2675f2b68794ef6712e1ea0b9ec110c46c9e5ebf (diff) | |
download | haskell-1c83695b5b9ae3175c18908c1d58aeadb1f225ae.tar.gz |
Changes for the new IO library, mainly base-package modules moving around
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/GhciMonad.hs | 6 | ||||
-rw-r--r-- | ghc/InteractiveUI.hs | 13 |
2 files changed, 15 insertions, 4 deletions
diff --git a/ghc/GhciMonad.hs b/ghc/GhciMonad.hs index 341e94a5e3..ff34963b63 100644 --- a/ghc/GhciMonad.hs +++ b/ghc/GhciMonad.hs @@ -363,9 +363,9 @@ initInterpBuffering = do -- make sure these are linked -- ToDo: we should really look up these names properly, but -- it's a fiddle and not all the bits are exposed via the GHC -- interface. - mb_stdin_ptr <- ObjLink.lookupSymbol "base_GHCziHandle_stdin_closure" - mb_stdout_ptr <- ObjLink.lookupSymbol "base_GHCziHandle_stdout_closure" - mb_stderr_ptr <- ObjLink.lookupSymbol "base_GHCziHandle_stderr_closure" + mb_stdin_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stdin_closure" + mb_stdout_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stdout_closure" + mb_stderr_ptr <- ObjLink.lookupSymbol "base_GHCziIOziHandleziFD_stderr_closure" let f ref (Just ptr) = writeIORef ref ptr f _ Nothing = panic "interactiveUI:setBuffering2" diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index d6202907d1..82c9aab84c 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -55,6 +55,11 @@ import Maybes ( orElse, expectJust ) import FastString import Encoding +#if __GLASGOW_HASKELL__ < 611 +import Foreign.C +import Encoding +#endif + #ifndef mingw32_HOST_OS import System.Posix hiding (getEnv) #else @@ -88,7 +93,13 @@ import Control.Monad as Monad import Text.Printf import Foreign import GHC.Exts ( unsafeCoerce# ) + +#if __GLASGOW_HASKELL__ >= 611 +import GHC.IO.Exception ( IOErrorType(InvalidArgument) ) +#else import GHC.IOBase ( IOErrorType(InvalidArgument) ) +#endif + import GHC.TopHandler import Data.IORef ( IORef, readIORef, writeIORef ) @@ -501,7 +512,7 @@ fileLoop hdl = do -- this can happen if the user closed stdin, or -- perhaps did getContents which closes stdin at -- EOF. - Right l -> fmap Just (Encoding.decode (BS.pack l)) + Right l -> return (Just l) mkPrompt :: GHCi String mkPrompt = do |