[project @ 2004-07-30 23:29:41 by ross]
[ghc-base.git] / Control / Exception.hs
index 51bd404..20105e8 100644 (file)
@@ -106,8 +106,10 @@ module Control.Exception (
 
        finally,        -- :: IO a -> IO b -> IO a
        
-       setUncatchedExceptionHandler,      -- :: (Exception -> IO ()) -> IO ()
-       getUncatchedExceptionHandler       -- :: IO (Exception -> IO ())
+#ifdef __GLASGOW_HASKELL__
+       setUncaughtExceptionHandler,      -- :: (Exception -> IO ()) -> IO ()
+       getUncaughtExceptionHandler       -- :: IO (Exception -> IO ())
+#endif
   ) where
 
 #ifdef __GLASGOW_HASKELL__
@@ -511,9 +513,10 @@ assert False _ = throw (AssertionFailed "")
 #endif
 
 
-{-# NOINLINE uncatchedExceptionHandler #-}
-uncatchedExceptionHandler :: IORef (Exception -> IO ())
-uncatchedExceptionHandler = unsafePerformIO (newIORef defaultHandler)
+#ifdef __GLASGOW_HASKELL__
+{-# NOINLINE uncaughtExceptionHandler #-}
+uncaughtExceptionHandler :: IORef (Exception -> IO ())
+uncaughtExceptionHandler = unsafePerformIO (newIORef defaultHandler)
    where
       defaultHandler :: Exception -> IO ()
       defaultHandler ex = do
@@ -527,8 +530,9 @@ uncatchedExceptionHandler = unsafePerformIO (newIORef defaultHandler)
 foreign import ccall unsafe "writeErrString__"
        writeErrString :: CString -> Int -> IO ()
 
-setUncatchedExceptionHandler :: (Exception -> IO ()) -> IO ()
-setUncatchedExceptionHandler = writeIORef uncatchedExceptionHandler
+setUncaughtExceptionHandler :: (Exception -> IO ()) -> IO ()
+setUncaughtExceptionHandler = writeIORef uncaughtExceptionHandler
 
-getUncatchedExceptionHandler :: IO (Exception -> IO ())
-getUncatchedExceptionHandler = readIORef uncatchedExceptionHandler
+getUncaughtExceptionHandler :: IO (Exception -> IO ())
+getUncaughtExceptionHandler = readIORef uncaughtExceptionHandler
+#endif