X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Foreign%2FStablePtr.hs;h=9554060c5845c819423e6e2211450031571745aa;hb=5b84927b0514239560752d617c9300b751bfb8a7;hp=cc53e9c330aa33ef264fade0804139b74b25db7a;hpb=f7a485978f04e84b086f1974b88887cc72d832d0;p=haskell-directory.git diff --git a/Foreign/StablePtr.hs b/Foreign/StablePtr.hs index cc53e9c..9554060 100644 --- a/Foreign/StablePtr.hs +++ b/Foreign/StablePtr.hs @@ -1,4 +1,4 @@ -{-# OPTIONS -fno-implicit-prelude #-} +{-# OPTIONS_GHC -fno-implicit-prelude #-} ----------------------------------------------------------------------------- -- | -- Module : Foreign.StablePtr @@ -17,7 +17,7 @@ module Foreign.StablePtr ( -- * Stable references to Haskell values - StablePtr, -- abstract + StablePtr -- abstract , newStablePtr -- :: a -> IO (StablePtr a) , deRefStablePtr -- :: StablePtr a -> IO a , freeStablePtr -- :: StablePtr a -> IO () @@ -33,6 +33,20 @@ import GHC.Stable import GHC.Err #endif +#ifdef __HUGS__ +import Hugs.StablePtr +#endif + +#ifdef __NHC__ +import NHC.FFI + ( StablePtr + , newStablePtr + , deRefStablePtr + , freeStablePtr + , castStablePtrToPtr + , castPtrToStablePtr + ) +#endif -- $cinterface -- @@ -45,4 +59,4 @@ import GHC.Err -- pointers. In fact, they need not even be valid memory addresses. The only -- guarantee provided is that if they are passed back to Haskell land, the -- function 'deRefStablePtr' will be able to reconstruct the --- Haskell value refereed to by the stable pointer. +-- Haskell value referred to by the stable pointer.