From: simonmar Date: Tue, 4 Mar 2003 10:39:59 +0000 (+0000) Subject: [project @ 2003-03-04 10:39:58 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~1093 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=fa0d4eff529f5575a357b8361c96002d7f45e77f;p=ghc-hetmet.git [project @ 2003-03-04 10:39:58 by simonmar] Fix compilation breakage with GHC 4.08.x. --- diff --git a/ghc/compiler/main/DriverUtil.hs b/ghc/compiler/main/DriverUtil.hs index 17eb663..d9f095d 100644 --- a/ghc/compiler/main/DriverUtil.hs +++ b/ghc/compiler/main/DriverUtil.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: DriverUtil.hs,v 1.35 2002/10/17 14:26:18 simonmar Exp $ +-- $Id: DriverUtil.hs,v 1.36 2003/03/04 10:39:58 simonmar Exp $ -- -- Utils for the driver -- @@ -16,7 +16,8 @@ import Util import Panic import Config ( cLeadingUnderscore ) -import EXCEPTION as Exception +import EXCEPTION ( Exception, finally, throwDyn, catchDyn ) +import qualified EXCEPTION as Exception import DYNAMIC import DATA_IOREF ( IORef, readIORef, writeIORef ) diff --git a/ghc/compiler/typecheck/TcRnTypes.lhs b/ghc/compiler/typecheck/TcRnTypes.lhs index 9dd4351..69b0184 100644 --- a/ghc/compiler/typecheck/TcRnTypes.lhs +++ b/ghc/compiler/typecheck/TcRnTypes.lhs @@ -75,10 +75,11 @@ import Outputable import DATA_IOREF ( IORef, newIORef, readIORef, writeIORef ) import UNSAFE_IO ( unsafeInterleaveIO ) import FIX_IO ( fixIO ) -import EXCEPTION ( Exception(..), tryJust ) +import EXCEPTION ( Exception(..) ) import IO ( isUserError ) import Maybe ( mapMaybe ) import ListSetOps ( unionLists ) +import Panic ( tryJust ) \end{code} @@ -160,7 +161,7 @@ tryM :: TcRn m r -> TcRn m (Either Exception r) -- Reflect exception into TcRn monad tryM (TcRn thing) = TcRn (\ env -> tryJust tc_errors (thing env)) where -#if __GLASGOW_HASKELL__ > 504 +#if __GLASGOW_HASKELL__ > 504 || __GLASGOW_HASKELL__ < 500 tc_errors e@(IOException ioe) | isUserError ioe = Just e #else tc_errors e@(IOException _) | isUserError e = Just e diff --git a/ghc/compiler/utils/Panic.lhs b/ghc/compiler/utils/Panic.lhs index 29e99e9..72eefd4 100644 --- a/ghc/compiler/utils/Panic.lhs +++ b/ghc/compiler/utils/Panic.lhs @@ -16,9 +16,7 @@ module Panic showException, showGhcException, tryMost, installSignalHandlers, -#if __GLASGOW_HASKELL__ <= 408 - catchJust, ioErrors, throwTo, -#endif + catchJust, tryJust, ioErrors, throwTo, ) where #include "HsVersions.h" @@ -43,6 +41,10 @@ import EXCEPTION ( throwTo ) # endif /* GHC < 500 */ #endif /* mingw32_HOST_OS */ +#if __GLASGOW_HASKELL__ > 408 +import EXCEPTION ( catchJust, tryJust, ioErrors ) +#endif + import DYNAMIC import qualified EXCEPTION as Exception import TRACE ( trace ) @@ -173,6 +175,7 @@ Compatibility stuff: \begin{code} #if __GLASGOW_HASKELL__ <= 408 catchJust = Exception.catchIO +tryJust = Exception.tryIO ioErrors = Exception.justIoErrors throwTo = Exception.raiseInThread #endif