From 68f60ec9d6004e36d572bc3b2d38b25a16530706 Mon Sep 17 00:00:00 2001 From: malcolm Date: Tue, 27 May 2003 16:57:12 +0000 Subject: [PATCH] [project @ 2003-05-27 16:57:09 by malcolm] Unbreak for nhc98, after the addition of FinalizerPtr as a type synonym, and the change of Foreign.C.Types to export all newtypes abstract. --- Foreign/C/Error.hs | 4 ++++ Foreign/ForeignPtr.hs | 2 ++ Foreign/Marshal/Alloc.hs | 2 ++ Foreign/Marshal/Utils.hs | 6 +++++- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Foreign/C/Error.hs b/Foreign/C/Error.hs index 613dd1a..c6106e0 100644 --- a/Foreign/C/Error.hs +++ b/Foreign/C/Error.hs @@ -120,6 +120,10 @@ import System.IO.Unsafe ( unsafePerformIO ) {-# CBITS errno.c #-} #endif +#ifdef __NHC__ +import NHC.FFI ( CInt(..) ) +#endif + -- "errno" type -- ------------ diff --git a/Foreign/ForeignPtr.hs b/Foreign/ForeignPtr.hs index fce4a13..6d7ea1a 100644 --- a/Foreign/ForeignPtr.hs +++ b/Foreign/ForeignPtr.hs @@ -41,6 +41,7 @@ import Foreign.Ptr #ifdef __NHC__ import NHC.FFI ( ForeignPtr + , FinalizerPtr , newForeignPtr , addForeignPtrFinalizer , withForeignPtr @@ -83,6 +84,7 @@ instance Show (ForeignPtr a) where 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 diff --git a/Foreign/Marshal/Alloc.hs b/Foreign/Marshal/Alloc.hs index 1b9fe12..3cf7174 100644 --- a/Foreign/Marshal/Alloc.hs +++ b/Foreign/Marshal/Alloc.hs @@ -41,6 +41,7 @@ import GHC.Ptr import GHC.Err import GHC.Base #elif defined(__NHC__) +import NHC.FFI ( FinalizerPtr, CInt(..) ) import IO ( bracket ) #else import Control.Exception ( bracket ) @@ -50,6 +51,7 @@ import Control.Exception ( bracket ) import Hugs.ForeignPtr ( FinalizerPtr ) #endif + -- exported functions -- ------------------ diff --git a/Foreign/Marshal/Utils.hs b/Foreign/Marshal/Utils.hs index 06528b2..c88fb51 100644 --- a/Foreign/Marshal/Utils.hs +++ b/Foreign/Marshal/Utils.hs @@ -53,7 +53,7 @@ module Foreign.Marshal.Utils ( 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__ @@ -63,6 +63,10 @@ import GHC.Num import GHC.Base #endif +#ifdef __NHC__ +import NHC.FFI ( CInt(..) ) +#endif + -- combined allocation and marshalling -- ----------------------------------- -- 1.7.10.4