[project @ 2004-02-12 22:35:25 by krasimir]
authorkrasimir <unknown>
Thu, 12 Feb 2004 22:35:25 +0000 (22:35 +0000)
committerkrasimir <unknown>
Thu, 12 Feb 2004 22:35:25 +0000 (22:35 +0000)
The UncatchedExceptionHandler is defined only for GHC

Control/Exception.hs

index 51bd404..a8e9dd6 100644 (file)
@@ -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