X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=utils%2Fext-core%2FSetup.lhs;fp=utils%2Fext-core%2FSetup.lhs;h=35661d4b2a4c4e92aa23b539bd0af39326b32446;hb=709b34386e3866ae73a9ff1220a969188feacbfa;hp=12d5bc5e6b9256fe0e946cba721f9583baab9e57;hpb=7ee35159446d22f0054fb9450f8fa20b43e10600;p=ghc-hetmet.git diff --git a/utils/ext-core/Setup.lhs b/utils/ext-core/Setup.lhs index 12d5bc5..35661d4 100644 --- a/utils/ext-core/Setup.lhs +++ b/utils/ext-core/Setup.lhs @@ -1,8 +1,7 @@ #!/usr/bin/env runhaskell \begin{code} -{-# OPTIONS -Wall #-} +{-# OPTIONS -Wall -cpp #-} -import Control.Exception import Control.Monad import Distribution.PackageDescription import Distribution.Simple @@ -12,7 +11,7 @@ import System.Cmd import System.FilePath import System.Exit import System.Directory -import Control.Exception (try) +import Control.Exception main :: IO () main = do @@ -58,7 +57,12 @@ maybeUpdateFile source target = do r <- rawSystem "cmp" ["-s" {-quiet-}, source, target] case r of ExitSuccess -> removeFile source - ExitFailure _ -> do (try :: IO () -> IO (Either IOException ())) (removeFile target); renameFile source target - - + ExitFailure _ -> do +#if __GLASGOW_HASKELL__ >= 610 + (try :: IO () -> IO (Either IOException ())) +#else + try +#endif + (removeFile target) + renameFile source target \end{code} \ No newline at end of file