@@ -84,7 +84,9 @@ import Control.Monad ( when, filterM, liftM )
84
84
import System.Directory ( doesFileExist , removeFile )
85
85
import Foreign.C.String ( CString , withCString , peekCString )
86
86
87
+ #if !MIN_VERSION_ghc(7,2,0)
87
88
import GHC ( defaultCallbacks )
89
+ #endif
88
90
import GHC.Ptr ( Ptr (.. ), nullPtr )
89
91
import GHC.Exts ( addrToHValue # )
90
92
import GHC.Prim ( unsafeCoerce # )
@@ -99,7 +101,11 @@ ifaceModuleName = moduleNameString . moduleName . mi_module
99
101
readBinIface' :: FilePath -> IO ModIface
100
102
readBinIface' hi_path = do
101
103
-- kludgy as hell
104
+ #if MIN_VERSION_ghc(7,2,0)
105
+ e <- newHscEnv undefined
106
+ #else
102
107
e <- newHscEnv defaultCallbacks undefined
108
+ #endif
103
109
initTcRnIf ' r' e undefined undefined (readBinIface IgnoreHiWay QuietBinIFaceReading hi_path)
104
110
105
111
-- TODO need a loadPackage p package.conf :: IO () primitive
@@ -679,7 +685,11 @@ loadDepends obj incpaths = do
679
685
680
686
-- and find some packages to load, as well.
681
687
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
682
691
ps' <- filterM loaded . map packageIdString . nub $ ps
692
+ #endif
683
693
684
694
#if DEBUG
685
695
when (not (null ps')) $
0 commit comments