From: krasimir Date: Thu, 12 Feb 2004 22:35:25 +0000 (+0000) Subject: [project @ 2004-02-12 22:35:25 by krasimir] X-Git-Tag: nhc98-1-18-release~385 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=0e74e637ee39fb0a12c9e76b7cd9dbfcd6fa6453;p=haskell-directory.git [project @ 2004-02-12 22:35:25 by krasimir] The UncatchedExceptionHandler is defined only for GHC --- diff --git a/Control/Exception.hs b/Control/Exception.hs index 51bd404..a8e9dd6 100644 --- a/Control/Exception.hs +++ b/Control/Exception.hs @@ -106,8 +106,10 @@ module Control.Exception ( finally, -- :: IO a -> IO b -> IO a +#ifdef __GLASGOW_HASKELL__ setUncatchedExceptionHandler, -- :: (Exception -> IO ()) -> IO () getUncatchedExceptionHandler -- :: IO (Exception -> IO ()) +#endif ) where #ifdef __GLASGOW_HASKELL__ @@ -116,13 +118,14 @@ import GHC.Exception as ExceptionBase hiding (catch) import GHC.Conc ( throwTo, ThreadId ) import GHC.IOBase ( IO(..), IORef(..), newIORef, readIORef, writeIORef ) import GHC.Handle ( stdout, hFlush ) -import Foreign.C.String ( CString, withCStringLen ) #endif #ifdef __HUGS__ import Hugs.Exception as ExceptionBase #endif +import Foreign.C.String ( CString, withCStringLen ) + import Prelude hiding ( catch ) import System.IO.Error hiding ( catch, try ) import System.IO.Unsafe (unsafePerformIO) @@ -511,6 +514,7 @@ assert False _ = throw (AssertionFailed "") #endif +#ifdef __GLASGOW_HASKELL__ {-# NOINLINE uncatchedExceptionHandler #-} uncatchedExceptionHandler :: IORef (Exception -> IO ()) uncatchedExceptionHandler = unsafePerformIO (newIORef defaultHandler) @@ -532,3 +536,4 @@ setUncatchedExceptionHandler = writeIORef uncatchedExceptionHandler getUncatchedExceptionHandler :: IO (Exception -> IO ()) getUncatchedExceptionHandler = readIORef uncatchedExceptionHandler +#endif \ No newline at end of file