Commit fa0d4eff authored by simonmar's avatar simonmar
Browse files

[project @ 2003-03-04 10:39:58 by simonmar]

Fix compilation breakage with GHC 4.08.x.
parent 81cbad07
-----------------------------------------------------------------------------
-- $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 )
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment