From 7f2529748488a004c1b4d748ddce0eecf71656be Mon Sep 17 00:00:00 2001 From: Manuel M T Chakravarty Date: Wed, 10 Oct 2007 10:18:40 +0000 Subject: [PATCH] Fix warnings when build w/o readline --- compiler/ghci/InteractiveUI.hs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index ff794d0..31ca03f 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -22,9 +22,13 @@ import GHC ( Session, LoadHowMuch(..), Target(..), TargetId(..), BreakIndex, SrcSpan, Resume, SingleStep ) import PprTyThing import DynFlags + +#ifdef USE_READLINE import Packages import PackageConfig import UniqFM +#endif + import HscTypes ( implicitTyThings ) import Outputable hiding (printForUser) import Module -- for ModuleEnv @@ -83,7 +87,9 @@ import GHC.IOBase ( IOErrorType(InvalidArgument) ) import Data.IORef ( IORef, readIORef, writeIORef ) +#ifdef USE_READLINE import System.Posix.Internals ( setNonBlockingFD ) +#endif ----------------------------------------------------------------------------- @@ -1347,6 +1353,11 @@ showContext = do completeNone :: String -> IO [String] completeNone _w = return [] +completeMacro, completeIdentifier, completeModule, + completeHomeModule, completeSetOptions, completeFilename, + completeHomeModuleOrFile + :: String -> IO [String] + #ifdef USE_READLINE completeWord :: String -> Int -> Int -> IO (Maybe (String, [String])) completeWord w start end = do @@ -1381,12 +1392,7 @@ completeWord w start end = do | offset+length x >= start = (start-offset,take (end-offset) x) | otherwise = selectWord xs - -completeCmd, completeMacro, completeIdentifier, completeModule, - completeHomeModule, completeSetOptions, completeFilename, - completeHomeModuleOrFile - :: String -> IO [String] - +completeCmd :: String -> IO [String] completeCmd w = do cmds <- readIORef commands return (filter (w `isPrefixOf`) (map (':':) (map cmdName cmds))) @@ -1452,7 +1458,6 @@ allExposedModules dflags where pkg_db = pkgIdMap (pkgState dflags) #else -completeCmd = completeNone completeMacro = completeNone completeIdentifier = completeNone completeModule = completeNone @@ -1460,7 +1465,6 @@ completeHomeModule = completeNone completeSetOptions = completeNone completeFilename = completeNone completeHomeModuleOrFile=completeNone -completeBkpt = completeNone #endif -- --------------------------------------------------------------------------- -- 1.7.10.4