Follow extensible exception changes
[ghc-hetmet.git] / compiler / utils / Panic.lhs
index ffd3b67..71c484e 100644 (file)
@@ -22,8 +22,6 @@ module Panic
      installSignalHandlers, interruptTargetThread
    ) where
 
--- XXX This define is a bit of a hack, and should be done more nicely
-#define FAST_STRING_NOT_NEEDED 1
 #include "HsVersions.h"
 
 import Config
@@ -33,14 +31,13 @@ import FastTypes
 import System.Posix.Signals
 #endif /* mingw32_HOST_OS */
 
-#if defined(mingw32_HOST_OS) && __GLASGOW_HASKELL__ >= 603
+#if defined(mingw32_HOST_OS)
 import GHC.ConsoleHandler
 #endif
 
-import Control.Exception
+import Exception
 import Control.Concurrent ( MVar, ThreadId, withMVar, newMVar )
 import Data.Dynamic
-import qualified Control.Exception as Exception
 import Debug.Trace     ( trace )
 import System.IO.Unsafe        ( unsafePerformIO )
 import System.IO.Error ( isUserError )
@@ -118,18 +115,11 @@ showGhcException (Panic s)
                 ++ s ++ "\n\n"
                 ++ "Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug\n")
 
-myMkTyConApp :: TyCon -> [TypeRep] -> TypeRep
-#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 603
-myMkTyConApp = mkAppTy
-#else 
-myMkTyConApp = mkTyConApp
-#endif
-
 ghcExceptionTc :: TyCon
 ghcExceptionTc = mkTyCon "GhcException"
 {-# NOINLINE ghcExceptionTc #-}
 instance Typeable GhcException where
-  typeOf _ = myMkTyConApp ghcExceptionTc []
+  typeOf _ = mkTyConApp ghcExceptionTc []
 \end{code}
 
 Panics and asserts.
@@ -177,7 +167,7 @@ tryUser action = tryJust tc_errors action
   where 
        tc_errors e@(Exception.IOException ioe) | isUserError ioe = Just e
        tc_errors _other = Nothing
-\end{code}     
+\end{code}
 
 Standard signal handlers for catching ^C, which just throw an
 exception in the target thread.  The current target thread is
@@ -200,7 +190,7 @@ installSignalHandlers = do
   installHandler sigQUIT (Catch interrupt) Nothing 
   installHandler sigINT  (Catch interrupt) Nothing
   return ()
-#elif __GLASGOW_HASKELL__ >= 603
+#else
   -- GHC 6.3+ has support for console events on Windows
   -- NOTE: running GHCi under a bash shell for some reason requires
   -- you to press Ctrl-Break rather than Ctrl-C to provoke
@@ -212,8 +202,6 @@ installSignalHandlers = do
 
   installHandler (Catch sig_handler)
   return ()
-#else
-  return () -- nothing
 #endif
 
 {-# NOINLINE interruptTargetThread #-}