Unbreak for nhc98, after the addition of FinalizerPtr as a type synonym,
and the change of Foreign.C.Types to export all newtypes abstract.
{-# CBITS errno.c #-}
#endif
+#ifdef __NHC__
+import NHC.FFI ( CInt(..) )
+#endif
+
-- "errno" type
-- ------------
#ifdef __NHC__
import NHC.FFI
( ForeignPtr
+ , FinalizerPtr
, newForeignPtr
, addForeignPtrFinalizer
, withForeignPtr
showsPrec p f = showsPrec p (foreignPtrToPtr f)
#endif
+
#ifndef __NHC__
withForeignPtr :: ForeignPtr a -> (Ptr a -> IO b) -> IO b
-- ^This is a way to look at the pointer living inside a
import GHC.Err
import GHC.Base
#elif defined(__NHC__)
+import NHC.FFI ( FinalizerPtr, CInt(..) )
import IO ( bracket )
#else
import Control.Exception ( bracket )
import Hugs.ForeignPtr ( FinalizerPtr )
#endif
+
-- exported functions
-- ------------------
import Data.Maybe
import Foreign.Ptr ( Ptr, nullPtr )
import Foreign.Storable ( Storable(poke) )
-import Foreign.C.Types ( CSize, CInt(..) )
+import Foreign.C.Types ( CSize )
import Foreign.Marshal.Alloc ( malloc, alloca )
#ifdef __GLASGOW_HASKELL__
import GHC.Base
#endif
+#ifdef __NHC__
+import NHC.FFI ( CInt(..) )
+#endif
+
-- combined allocation and marshalling
-- -----------------------------------