From: ross Date: Thu, 13 Jan 2005 11:14:09 +0000 (+0000) Subject: [project @ 2005-01-13 11:14:09 by ross] X-Git-Tag: nhc98-1-18-release~118 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=5d2171fd1b2a2fed99e1b2502d5611a11031efc5;p=ghc-base.git [project @ 2005-01-13 11:14:09 by ross] Hugs only: replace UserError with ResourceExhausted --- diff --git a/Foreign/Marshal/Alloc.hs b/Foreign/Marshal/Alloc.hs index 67e81eb..8a89467 100644 --- a/Foreign/Marshal/Alloc.hs +++ b/Foreign/Marshal/Alloc.hs @@ -51,6 +51,8 @@ import Control.Exception ( bracket ) #endif #ifdef __HUGS__ +import Hugs.Prelude ( IOException(IOError), + IOErrorType(ResourceExhausted) ) import Hugs.ForeignPtr ( FinalizerPtr ) #endif @@ -173,8 +175,8 @@ failWhenNULL :: String -> IO (Ptr a) -> IO (Ptr a) failWhenNULL name f = do addr <- f if addr == nullPtr -#ifdef __GLASGOW_HASKELL__ - then ioException (IOError Nothing ResourceExhausted name +#if __GLASGOW_HASKELL__ || __HUGS__ + then ioError (IOError Nothing ResourceExhausted name "out of memory" Nothing) #else then ioError (userError (name++": out of memory"))