For nhc98, define mallocForeignPtr and friends.
, touchForeignPtr
, castForeignPtr
, touchForeignPtr
, castForeignPtr
, mallocForeignPtr
, mallocForeignPtrBytes
, mallocForeignPtrArray
, mallocForeignPtrArray0
, mallocForeignPtr
, mallocForeignPtrBytes
, mallocForeignPtrArray
, mallocForeignPtrArray0
, unsafeForeignPtrToPtr
, touchForeignPtr
, castForeignPtr
, unsafeForeignPtrToPtr
, touchForeignPtr
, castForeignPtr
+ , Storable(sizeOf)
+ , malloc, mallocBytes, finalizerFree
unsafeForeignPtrToPtr = foreignPtrToPtr
#endif
unsafeForeignPtrToPtr = foreignPtrToPtr
#endif
+#ifndef __GLASGOW_HASKELL__
mallocForeignPtr :: Storable a => IO (ForeignPtr a)
mallocForeignPtr = do
r <- malloc
mallocForeignPtr :: Storable a => IO (ForeignPtr a)
mallocForeignPtr = do
r <- malloc
mallocForeignPtrBytes n = do
r <- mallocBytes n
newForeignPtr r finalizerFree
mallocForeignPtrBytes n = do
r <- mallocBytes n
newForeignPtr r finalizerFree
+#endif /* __HUGS__ || __NHC__ */
mallocForeignPtrArray :: Storable a => Int -> IO (ForeignPtr a)
mallocForeignPtrArray = doMalloc undefined
where
mallocForeignPtrArray :: Storable a => Int -> IO (ForeignPtr a)
mallocForeignPtrArray = doMalloc undefined
where
mallocForeignPtrArray0 :: Storable a => Int -> IO (ForeignPtr a)
mallocForeignPtrArray0 size = mallocForeignPtrArray (size + 1)
mallocForeignPtrArray0 :: Storable a => Int -> IO (ForeignPtr a)
mallocForeignPtrArray0 size = mallocForeignPtrArray (size + 1)