From 5d2171fd1b2a2fed99e1b2502d5611a11031efc5 Mon Sep 17 00:00:00 2001 From: ross Date: Thu, 13 Jan 2005 11:14:09 +0000 Subject: [PATCH] [project @ 2005-01-13 11:14:09 by ross] Hugs only: replace UserError with ResourceExhausted --- Foreign/Marshal/Alloc.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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")) -- 1.7.10.4