summaryrefslogtreecommitdiff
path: root/libraries/base/Foreign/Ptr.hs
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-02-15 20:51:56 +0000
committerIan Lynagh <ian@well-typed.com>2013-02-15 20:51:56 +0000
commit25d1eafeb41f046630f978da3655ae578c9c83b1 (patch)
tree6cb8dc7b9d0b1dfddbdec07b0f3e652b41947aa8 /libraries/base/Foreign/Ptr.hs
parentab1d58b71736b629d28e3ce48310414880dabca3 (diff)
downloadhaskell-25d1eafeb41f046630f978da3655ae578c9c83b1.tar.gz
Remove nhc98-specific files and content
Diffstat (limited to 'libraries/base/Foreign/Ptr.hs')
-rw-r--r--libraries/base/Foreign/Ptr.hs31
1 files changed, 5 insertions, 26 deletions
diff --git a/libraries/base/Foreign/Ptr.hs b/libraries/base/Foreign/Ptr.hs
index b0a1a8ab8e..4632714052 100644
--- a/libraries/base/Foreign/Ptr.hs
+++ b/libraries/base/Foreign/Ptr.hs
@@ -47,7 +47,6 @@ module Foreign.Ptr (
freeHaskellFunPtr,
-- Free the function pointer created by foreign export dynamic.
-#ifndef __NHC__
-- * Integral types with lossless conversion to and from pointers
IntPtr,
ptrToIntPtr,
@@ -55,7 +54,6 @@ module Foreign.Ptr (
WordPtr,
ptrToWordPtr,
wordPtrToPtr
-#endif
) where
#ifdef __GLASGOW_HASKELL__
@@ -75,23 +73,6 @@ import Data.Bits
import Data.Typeable
import Foreign.Storable ( Storable(..) )
-#ifdef __NHC__
-import NHC.FFI
- ( Ptr
- , nullPtr
- , castPtr
- , plusPtr
- , alignPtr
- , minusPtr
- , FunPtr
- , nullFunPtr
- , castFunPtr
- , castFunPtrToPtr
- , castPtrToFunPtr
- , freeHaskellFunPtr
- )
-#endif
-
#ifdef __HUGS__
import Hugs.Ptr
#endif
@@ -105,11 +86,10 @@ foreign import ccall unsafe "freeHaskellFunctionPtr"
freeHaskellFunPtr :: FunPtr a -> IO ()
#endif
-#ifndef __NHC__
-# include "HsBaseConfig.h"
-# include "CTypes.h"
+#include "HsBaseConfig.h"
+#include "CTypes.h"
-# ifdef __GLASGOW_HASKELL__
+#ifdef __GLASGOW_HASKELL__
-- | An unsigned integral type that can be losslessly converted to and from
-- @Ptr@. This type is also compatible with the C99 type @uintptr_t@, and
-- can be marshalled to and from that type safely.
@@ -138,7 +118,7 @@ ptrToIntPtr (Ptr a#) = IntPtr (I# (addr2Int# a#))
intPtrToPtr :: IntPtr -> Ptr a
intPtrToPtr (IntPtr (I# i#)) = Ptr (int2Addr# i#)
-# else /* !__GLASGOW_HASKELL__ */
+#else /* !__GLASGOW_HASKELL__ */
INTEGRAL_TYPE(WordPtr,tyConWordPtr,"WordPtr",CUIntPtr)
INTEGRAL_TYPE(IntPtr,tyConIntPtr,"IntPtr",CIntPtr)
@@ -157,6 +137,5 @@ foreign import ccall unsafe "__hscore_to_intptr"
foreign import ccall unsafe "__hscore_from_intptr"
intPtrToPtr :: IntPtr -> Ptr a
-# endif /* !__GLASGOW_HASKELL__ */
-#endif /* !__NHC_ */
+#endif /* !__GLASGOW_HASKELL__ */