Adapt to work with GHC 6.12
- Adapted the package to work with GHC 6.12 - Plugins that depend on the old base3 are currently not correctly loaded as the plugin loaded misses the dependence on syb (leading to unresolved symbols) - Cleaned up most of the testsuite (there are still some outstanding failures, of which only one demonstrates a bug in the plugins library as far as I can see — see previous bullet point) - Cleaned out a little cruft (but more could be done)
This commit is contained in:
@ -81,6 +81,7 @@ import Control.Monad ( when, filterM, liftM )
|
||||
import System.Directory ( doesFileExist, removeFile )
|
||||
import Foreign.C.String ( CString, withCString, peekCString )
|
||||
|
||||
import GHC ( defaultCallbacks )
|
||||
import GHC.Ptr ( Ptr(..), nullPtr )
|
||||
import GHC.Exts ( addrToHValue# )
|
||||
import GHC.Prim ( unsafeCoerce# )
|
||||
@ -95,7 +96,7 @@ ifaceModuleName = moduleNameString . moduleName . mi_module
|
||||
readBinIface' :: FilePath -> IO ModIface
|
||||
readBinIface' hi_path = do
|
||||
-- kludgy as hell
|
||||
e <- newHscEnv undefined
|
||||
e <- newHscEnv defaultCallbacks undefined
|
||||
initTcRnIf 'r' e undefined undefined (readBinIface IgnoreHiWay QuietBinIFaceReading hi_path)
|
||||
|
||||
-- TODO need a loadPackage p package.conf :: IO () primitive
|
||||
@ -438,7 +439,7 @@ loadFunction__ pkg m valsym
|
||||
#if DEBUG
|
||||
putStrLn $ "Looking for <<"++symbol++">>"
|
||||
#endif
|
||||
ptr@(~(Ptr addr)) <- withCString symbol c_lookupSymbol
|
||||
ptr@(Ptr addr) <- withCString symbol c_lookupSymbol
|
||||
if (ptr == nullPtr)
|
||||
then return Nothing
|
||||
else case addrToHValue# addr of
|
||||
@ -706,7 +707,7 @@ getImports m = do
|
||||
-- ---------------------------------------------------------------------
|
||||
-- C interface
|
||||
--
|
||||
foreign import ccall threadsafe "lookupSymbol"
|
||||
foreign import ccall safe "lookupSymbol"
|
||||
c_lookupSymbol :: CString -> IO (Ptr a)
|
||||
|
||||
foreign import ccall unsafe "loadObj"
|
||||
|
Reference in New Issue
Block a user