-{-# OPTIONS_GHC -XNoImplicitPrelude #-}
+{-# LANGUAGE CPP
+ , NoImplicitPrelude
+ , ForeignFunctionInterface
+ , MagicHash
+ , GeneralizedNewtypeDeriving
+ #-}
+
-----------------------------------------------------------------------------
-- |
-- Module : Foreign.Ptr
#ifdef __GLASGOW_HASKELL__
import GHC.Ptr
-import GHC.IOBase
import GHC.Base
import GHC.Num
import GHC.Read
import GHC.Enum
import GHC.Word ( Word(..) )
-import Data.Int
+-- import Data.Int
import Data.Word
#else
import Control.Monad ( liftM )
# 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