summaryrefslogtreecommitdiff
path: root/libraries/base/Foreign
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2013-09-15 10:58:00 +0200
committerHerbert Valerio Riedel <hvr@gnu.org>2013-09-17 09:47:55 +0200
commit43ece172e7045d5ba633be6193f3e908eaa81f00 (patch)
treef1e25c06b710a5087173daf5eb01b94ab8517917 /libraries/base/Foreign
parent907cd8c36b6c249dcb8af19f05303e34eb4e8de4 (diff)
downloadhaskell-43ece172e7045d5ba633be6193f3e908eaa81f00.tar.gz
Remove Hugs98 specific code
For rationale. see http://permalink.gmane.org/gmane.comp.lang.haskell.ghc.devel/2349 Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Diffstat (limited to 'libraries/base/Foreign')
-rw-r--r--libraries/base/Foreign/C/Error.hs8
-rw-r--r--libraries/base/Foreign/C/Types.hs4
-rw-r--r--libraries/base/Foreign/ForeignPtr.hs4
-rw-r--r--libraries/base/Foreign/ForeignPtr/Imp.hs13
-rw-r--r--libraries/base/Foreign/ForeignPtr/Safe.hs4
-rw-r--r--libraries/base/Foreign/Marshal/Alloc.hs10
-rw-r--r--libraries/base/Foreign/Ptr.hs4
-rw-r--r--libraries/base/Foreign/StablePtr.hs4
-rw-r--r--libraries/base/Foreign/Storable.hs9
9 files changed, 8 insertions, 52 deletions
diff --git a/libraries/base/Foreign/C/Error.hs b/libraries/base/Foreign/C/Error.hs
index d2f1580ff3..0d10201a36 100644
--- a/libraries/base/Foreign/C/Error.hs
+++ b/libraries/base/Foreign/C/Error.hs
@@ -102,9 +102,6 @@ import GHC.IO.Exception
import GHC.IO.Handle.Types
import GHC.Num
import GHC.Base
-#elif __HUGS__
-import Hugs.Prelude ( Handle, IOError, ioError )
-import System.IO.Unsafe ( unsafePerformIO )
#else
import System.IO ( Handle )
import System.IO.Error ( IOError, ioError )
@@ -112,11 +109,6 @@ import System.IO.Unsafe ( unsafePerformIO )
import Foreign.Storable ( Storable(poke,peek) )
#endif
-#ifdef __HUGS__
-{-# CFILES cbits/PrelIOUtils.c #-}
-#endif
-
-
-- "errno" type
-- ------------
diff --git a/libraries/base/Foreign/C/Types.hs b/libraries/base/Foreign/C/Types.hs
index 5f296d5f65..bde6be51a1 100644
--- a/libraries/base/Foreign/C/Types.hs
+++ b/libraries/base/Foreign/C/Types.hs
@@ -94,10 +94,6 @@ import GHC.Num
import Control.Monad ( liftM )
#endif
-#ifdef __HUGS__
-import Hugs.Ptr ( castPtr )
-#endif
-
#include "HsBaseConfig.h"
#include "CTypes.h"
diff --git a/libraries/base/Foreign/ForeignPtr.hs b/libraries/base/Foreign/ForeignPtr.hs
index b980f502cd..6219adb0eb 100644
--- a/libraries/base/Foreign/ForeignPtr.hs
+++ b/libraries/base/Foreign/ForeignPtr.hs
@@ -22,14 +22,14 @@ module Foreign.ForeignPtr (
-- * Finalised data pointers
ForeignPtr
, FinalizerPtr
-#if defined(__HUGS__) || defined(__GLASGOW_HASKELL__)
+#ifdef __GLASGOW_HASKELL__
, FinalizerEnvPtr
#endif
-- ** Basic operations
, newForeignPtr
, newForeignPtr_
, addForeignPtrFinalizer
-#if defined(__HUGS__) || defined(__GLASGOW_HASKELL__)
+#ifdef __GLASGOW_HASKELL__
, newForeignPtrEnv
, addForeignPtrFinalizerEnv
#endif
diff --git a/libraries/base/Foreign/ForeignPtr/Imp.hs b/libraries/base/Foreign/ForeignPtr/Imp.hs
index 19d31b8581..9499fbce8d 100644
--- a/libraries/base/Foreign/ForeignPtr/Imp.hs
+++ b/libraries/base/Foreign/ForeignPtr/Imp.hs
@@ -23,14 +23,14 @@ module Foreign.ForeignPtr.Imp
-- * Finalised data pointers
ForeignPtr
, FinalizerPtr
-#if defined(__HUGS__) || defined(__GLASGOW_HASKELL__)
+#ifdef __GLASGOW_HASKELL__
, FinalizerEnvPtr
#endif
-- ** Basic operations
, newForeignPtr
, newForeignPtr_
, addForeignPtrFinalizer
-#if defined(__HUGS__) || defined(__GLASGOW_HASKELL__)
+#ifdef __GLASGOW_HASKELL__
, newForeignPtrEnv
, addForeignPtrFinalizerEnv
#endif
@@ -54,11 +54,6 @@ module Foreign.ForeignPtr.Imp
where
import Foreign.Ptr
-
-#ifdef __HUGS__
-import Hugs.ForeignPtr
-#endif
-
import Foreign.Storable ( Storable(sizeOf) )
#ifdef __GLASGOW_HASKELL__
@@ -117,7 +112,7 @@ withForeignPtr fo io
touchForeignPtr fo
return r
-#if defined(__HUGS__) || defined(__GLASGOW_HASKELL__)
+#ifdef __GLASGOW_HASKELL__
-- | This variant of 'newForeignPtr' adds a finalizer that expects an
-- environment in addition to the finalized pointer. The environment
-- that will be passed to the finalizer is fixed by the second argument to
@@ -128,7 +123,7 @@ newForeignPtrEnv finalizer env p
= do fObj <- newForeignPtr_ p
addForeignPtrFinalizerEnv finalizer env fObj
return fObj
-#endif /* __HUGS__ */
+#endif
#ifndef __GLASGOW_HASKELL__
mallocForeignPtr :: Storable a => IO (ForeignPtr a)
diff --git a/libraries/base/Foreign/ForeignPtr/Safe.hs b/libraries/base/Foreign/ForeignPtr/Safe.hs
index 4f1907242a..4289a98067 100644
--- a/libraries/base/Foreign/ForeignPtr/Safe.hs
+++ b/libraries/base/Foreign/ForeignPtr/Safe.hs
@@ -23,14 +23,14 @@ module Foreign.ForeignPtr.Safe (
-- * Finalised data pointers
ForeignPtr
, FinalizerPtr
-#if defined(__HUGS__) || defined(__GLASGOW_HASKELL__)
+#ifdef __GLASGOW_HASKELL__
, FinalizerEnvPtr
#endif
-- ** Basic operations
, newForeignPtr
, newForeignPtr_
, addForeignPtrFinalizer
-#if defined(__HUGS__) || defined(__GLASGOW_HASKELL__)
+#ifdef __GLASGOW_HASKELL__
, newForeignPtrEnv
, addForeignPtrFinalizerEnv
#endif
diff --git a/libraries/base/Foreign/Marshal/Alloc.hs b/libraries/base/Foreign/Marshal/Alloc.hs
index 6b0bcfb418..d68988d203 100644
--- a/libraries/base/Foreign/Marshal/Alloc.hs
+++ b/libraries/base/Foreign/Marshal/Alloc.hs
@@ -79,13 +79,6 @@ import GHC.Base
import Control.Exception.Base ( bracket )
#endif
-#ifdef __HUGS__
-import Hugs.Prelude ( IOException(IOError),
- IOErrorType(ResourceExhausted) )
-import Hugs.ForeignPtr ( FinalizerPtr )
-#endif
-
-
-- exported functions
-- ------------------
@@ -223,9 +216,6 @@ failWhenNULL name f = do
#if __GLASGOW_HASKELL__
then ioError (IOError Nothing ResourceExhausted name
"out of memory" Nothing Nothing)
-#elif __HUGS__
- then ioError (IOError Nothing ResourceExhausted name
- "out of memory" Nothing)
#else
then ioError (userError (name++": out of memory"))
#endif
diff --git a/libraries/base/Foreign/Ptr.hs b/libraries/base/Foreign/Ptr.hs
index 4632714052..9c8267ed2b 100644
--- a/libraries/base/Foreign/Ptr.hs
+++ b/libraries/base/Foreign/Ptr.hs
@@ -73,10 +73,6 @@ import Data.Bits
import Data.Typeable
import Foreign.Storable ( Storable(..) )
-#ifdef __HUGS__
-import Hugs.Ptr
-#endif
-
#ifdef __GLASGOW_HASKELL__
-- | Release the storage associated with the given 'FunPtr', which
-- must have been obtained from a wrapper stub. This should be called
diff --git a/libraries/base/Foreign/StablePtr.hs b/libraries/base/Foreign/StablePtr.hs
index db27b06063..47610d6439 100644
--- a/libraries/base/Foreign/StablePtr.hs
+++ b/libraries/base/Foreign/StablePtr.hs
@@ -34,10 +34,6 @@ module Foreign.StablePtr
import GHC.Stable
#endif
-#ifdef __HUGS__
-import Hugs.StablePtr
-#endif
-
-- $cinterface
--
-- The following definition is available to C programs inter-operating with
diff --git a/libraries/base/Foreign/Storable.hs b/libraries/base/Foreign/Storable.hs
index 36e0d26159..d8189a706b 100644
--- a/libraries/base/Foreign/Storable.hs
+++ b/libraries/base/Foreign/Storable.hs
@@ -56,12 +56,6 @@ import Data.Word
import Foreign.StablePtr
#endif
-#ifdef __HUGS__
-import Hugs.Prelude
-import Hugs.Ptr
-import Hugs.Storable
-#endif
-
{- |
The member functions of this class facilitate writing values of
primitive types to raw memory (which may have been allocated with the
@@ -190,9 +184,6 @@ instance Storable (T) where { \
#ifdef __GLASGOW_HASKELL__
STORABLE(Char,SIZEOF_INT32,ALIGNMENT_INT32,
readWideCharOffPtr,writeWideCharOffPtr)
-#elif defined(__HUGS__)
-STORABLE(Char,SIZEOF_HSCHAR,ALIGNMENT_HSCHAR,
- readCharOffPtr,writeCharOffPtr)
#endif
STORABLE(Int,SIZEOF_HSINT,ALIGNMENT_HSINT,