X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Foreign%2FPtr.hs;h=26dda5c23763fab24ae43e57b127a23b810da6ee;hb=4475dcabbc206d1cf0fc3fee88f600a4791d948c;hp=564bb1cb41b2d8b182eba896eb849f5e6b4e2f6e;hpb=1a2d88a60a8e2c8be84879d79f148d4c6ceb348e;p=ghc-base.git diff --git a/Foreign/Ptr.hs b/Foreign/Ptr.hs index 564bb1c..26dda5c 100644 --- a/Foreign/Ptr.hs +++ b/Foreign/Ptr.hs @@ -1,4 +1,13 @@ -{-# OPTIONS_GHC -XNoImplicitPrelude #-} +{-# LANGUAGE CPP + , NoImplicitPrelude + , ForeignFunctionInterface + , MagicHash + , GeneralizedNewtypeDeriving + #-} +#ifdef __GLASGOW_HASKELL__ +{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-} +#endif + ----------------------------------------------------------------------------- -- | -- Module : Foreign.Ptr @@ -58,7 +67,7 @@ import GHC.Show import GHC.Enum import GHC.Word ( Word(..) ) -import Data.Int +-- import Data.Int import Data.Word #else import Control.Monad ( liftM ) @@ -105,12 +114,14 @@ foreign import ccall unsafe "freeHaskellFunctionPtr" # ifdef __GLASGOW_HASKELL__ -- | An unsigned integral type that can be losslessly converted to and from --- @Ptr@. +-- @Ptr@. This type is also compatible with the C99 type @uintptr_t@, and +-- can be marshalled to and from that type safely. INTEGRAL_TYPE(WordPtr,tyConWordPtr,"WordPtr",Word) -- Word and Int are guaranteed pointer-sized in GHC -- | A signed integral type that can be losslessly converted to and from --- @Ptr@. +-- @Ptr@. This type is also compatible with the C99 type @intptr_t@, and +-- can be marshalled to and from that type safely. INTEGRAL_TYPE(IntPtr,tyConIntPtr,"IntPtr",Int) -- Word and Int are guaranteed pointer-sized in GHC