[project @ 2003-03-04 10:39:58 by simonmar]
authorsimonmar <unknown>
Tue, 4 Mar 2003 10:39:59 +0000 (10:39 +0000)
committersimonmar <unknown>
Tue, 4 Mar 2003 10:39:59 +0000 (10:39 +0000)
Fix compilation breakage with GHC 4.08.x.

ghc/compiler/main/DriverUtil.hs
ghc/compiler/typecheck/TcRnTypes.lhs
ghc/compiler/utils/Panic.lhs

index 17eb663..d9f095d 100644 (file)
@@ -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 )
 
index 9dd4351..69b0184 100644 (file)
@@ -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
index 29e99e9..72eefd4 100644 (file)
@@ -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