Hugs only: replace UserError with ResourceExhausted
#endif
#ifdef __HUGS__
+import Hugs.Prelude ( IOException(IOError),
+ IOErrorType(ResourceExhausted) )
import Hugs.ForeignPtr ( FinalizerPtr )
#endif
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"))