Skip to content

Commit c0b4642

Browse files
author
Brian Victor
committed
update plugins to support GHC >= 7.2 (via conditional compilation)
1 parent c90676d commit c0b4642

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/System/Plugins/Load.hs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ import Control.Monad ( when, filterM, liftM )
8484
import System.Directory ( doesFileExist, removeFile )
8585
import Foreign.C.String ( CString, withCString, peekCString )
8686

87+
#if !MIN_VERSION_ghc(7,2,0)
8788
import GHC ( defaultCallbacks )
89+
#endif
8890
import GHC.Ptr ( Ptr(..), nullPtr )
8991
import GHC.Exts ( addrToHValue# )
9092
import GHC.Prim ( unsafeCoerce# )
@@ -99,7 +101,11 @@ ifaceModuleName = moduleNameString . moduleName . mi_module
99101
readBinIface' :: FilePath -> IO ModIface
100102
readBinIface' hi_path = do
101103
-- kludgy as hell
104+
#if MIN_VERSION_ghc(7,2,0)
105+
e <- newHscEnv undefined
106+
#else
102107
e <- newHscEnv defaultCallbacks undefined
108+
#endif
103109
initTcRnIf 'r' e undefined undefined (readBinIface IgnoreHiWay QuietBinIFaceReading hi_path)
104110

105111
-- TODO need a loadPackage p package.conf :: IO () primitive
@@ -679,7 +685,11 @@ loadDepends obj incpaths = do
679685

680686
-- and find some packages to load, as well.
681687
let ps = dep_pkgs ds
688+
#if MIN_VERSION_ghc(7,2,0)
689+
ps' <- filterM loaded . map packageIdString . nub $ map fst ps
690+
#else
682691
ps' <- filterM loaded . map packageIdString . nub $ ps
692+
#endif
683693

684694
#if DEBUG
685695
when (not (null ps')) $

0 commit comments

Comments
 (0)