X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Foreign%2FForeignPtr.hs;h=b0dd4d5ec125bb8a0dff72490fdde1d574f73a0d;hb=29246dd4eb44d03cc48cbd894821d3c9501d8829;hp=586cd4f3392fba48ec7aa6698dd167bbc5616f6a;hpb=5feea6f48f51876033b43bc6012f6f568ebfd397;p=ghc-base.git diff --git a/Foreign/ForeignPtr.hs b/Foreign/ForeignPtr.hs index 586cd4f..b0dd4d5 100644 --- a/Foreign/ForeignPtr.hs +++ b/Foreign/ForeignPtr.hs @@ -26,17 +26,19 @@ module Foreign.ForeignPtr , touchForeignPtr -- :: ForeignPtr a -> IO () , castForeignPtr -- :: ForeignPtr a -> ForeignPtr b +#ifdef __GLASGOW_HASKELL__ -- * GHC extensions , mallocForeignPtr -- :: Storable a => IO (ForeignPtr a) , mallocForeignPtrBytes -- :: Int -> IO (ForeignPtr a) +#endif ) where +#ifdef __GLASGOW_HASKELL__ import Foreign.Ptr import Foreign.Storable import Data.Dynamic -#ifdef __GLASGOW_HASKELL__ import GHC.Base import GHC.IOBase import GHC.Num @@ -44,10 +46,22 @@ import GHC.Ptr ( Ptr(..) ) import GHC.Err #endif +#ifdef __NHC__ +import NHC.FFI + ( ForeignPtr + , newForeignPtr + , addForeignPtrFinalizer + , withForeignPtr + , foreignPtrToPtr + , touchForeignPtr + , castForeignPtr + ) +#endif + +#ifdef __GLASGOW_HASKELL__ #include "Dynamic.h" INSTANCE_TYPEABLE1(ForeignPtr,foreignPtrTc,"ForeignPtr") -#ifdef __GLASGOW_HASKELL__ -- |The type 'ForeignPtr' represents references to objects that are -- maintained in a foreign language, i.e., that are not part of the -- data structures usually managed by the Haskell storage manager.