[project @ 2005-01-13 11:14:09 by ross]
authorross <unknown>
Thu, 13 Jan 2005 11:14:09 +0000 (11:14 +0000)
committerross <unknown>
Thu, 13 Jan 2005 11:14:09 +0000 (11:14 +0000)
Hugs only: replace UserError with ResourceExhausted

Foreign/Marshal/Alloc.hs

index 67e81eb..8a89467 100644 (file)
@@ -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"))