X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Foreign%2FMarshal%2FAlloc.hs;h=8a8946769f072ddcf69735747ede749dc514497b;hb=6cc0d200c099facf4bdedf92553a9eb98fd88f0f;hp=65588ff76b338937eae81df755a3ffb587167e5e;hpb=bd1dd538e62a728e3cd37132e7393cee8b051cf9;p=ghc-base.git diff --git a/Foreign/Marshal/Alloc.hs b/Foreign/Marshal/Alloc.hs index 65588ff..8a89467 100644 --- a/Foreign/Marshal/Alloc.hs +++ b/Foreign/Marshal/Alloc.hs @@ -1,4 +1,4 @@ -{-# OPTIONS -fno-implicit-prelude #-} +{-# OPTIONS_GHC -fno-implicit-prelude #-} ----------------------------------------------------------------------------- -- | -- Module : Foreign.Marshal.Alloc @@ -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"))