X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=utils%2Fghc-pkg%2FMain.hs;h=344a21edb89cd5278db8146a3496b270e5b1acfe;hb=e5e6f6a16796cba5e2b6bd376481cf2cd0ba9734;hp=7dcc0d480658c9f0fc35cb14722ca3d288a856fc;hpb=37b4749847aa928188f61f6d5c180d7b2e07d424;p=ghc-hetmet.git diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index 7dcc0d4..344a21e 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -35,7 +35,6 @@ import Text.PrettyPrint import qualified Control.Exception as Exception import Data.Maybe -import Data.Bits import Data.Char ( isSpace, toLower ) import Control.Monad import System.Directory ( doesDirectoryExist, getDirectoryContents, @@ -47,9 +46,9 @@ import System.IO.Error (try) import Data.List import Control.Concurrent +import Foreign import Foreign.C #ifdef mingw32_HOST_OS -import Foreign import GHC.ConsoleHandler #else import System.Posix hiding (fdToHandle) @@ -1244,7 +1243,13 @@ openNewFile dir template = do -- XXX We want to tell fdToHandle what the filepath is, -- as any exceptions etc will only be able to report the -- fd currently - h <- fdToHandle fd `onException` c_close fd + h <- +#if __GLASGOW_HASKELL__ >= 609 + fdToHandle fd +#else + fdToHandle (fromIntegral fd) +#endif + `onException` c_close fd return (filepath, h) where filename = prefix ++ show x ++ suffix