From 0de2926cf91f884c876cffc428fbed626cedc343 Mon Sep 17 00:00:00 2001
From: sof <unknown>
Date: Tue, 21 Oct 1997 20:35:06 +0000
Subject: [PATCH] [project @ 1997-10-21 20:33:36 by sof] Avoid exposing
 ForeignObjs when compiling Parallel Haskell

---
 ghc/lib/ghc/PackBase.lhs | 4 ++++
 ghc/lib/required/IO.lhs  | 7 ++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/ghc/lib/ghc/PackBase.lhs b/ghc/lib/ghc/PackBase.lhs
index 138832948483..3e6934892011 100644
--- a/ghc/lib/ghc/PackBase.lhs
+++ b/ghc/lib/ghc/PackBase.lhs
@@ -34,10 +34,12 @@ module PackBase
 	unpackCStringBA#,  -- :: ByteArray#    -> Int# -> [Char]
 	unpackNBytesBA#,   -- :: ByteArray#    -> Int# -> [Char]
 
+#ifndef __PARALLEL_HASKELL__
 	unpackCStringFO,   -- :: ForeignObj    -> [Char]
 	unpackNBytesFO,    -- :: ForeignObj    -> Int  -> [Char]
 	unpackCStringFO#,  -- :: ForeignObj#   -> [Char]
 	unpackNBytesFO#,   -- :: ForeignObj#   -> Int# -> [Char]
+#endif
 
 	unpackFoldrCString#,  -- **
 	unpackAppendCString#  -- **
@@ -121,6 +123,7 @@ sequence of bytes into a list of @Char@s (a renamed version
 of the code above).
 
 \begin{code}
+#ifndef __PARALLEL_HASKELL__
 unpackCStringFO :: ForeignObj -> [Char]
 unpackCStringFO (ForeignObj fo#) = unpackCStringFO# fo#
 
@@ -147,6 +150,7 @@ unpackNBytesFO# fo len
       | otherwise  = C# ch : unpack (i +# 1#)
       where
 	ch = indexCharOffForeignObj# fo i
+#endif
 \end{code}
 
 
diff --git a/ghc/lib/required/IO.lhs b/ghc/lib/required/IO.lhs
index 87b4116fa3b1..25767d569d23 100644
--- a/ghc/lib/required/IO.lhs
+++ b/ghc/lib/required/IO.lhs
@@ -41,7 +41,12 @@ import IOHandle		-- much of the real stuff is in here
 import PackBase		( unpackNBytesST )
 import PrelBase
 import GHC
-import Foreign          ( ForeignObj, Addr, makeForeignObj, writeForeignObj )
+import Foreign  ( Addr, 
+#ifndef __PARALLEL_HASKELL__
+                  ForeignObj, makeForeignObj, writeForeignObj 
+#endif
+		  )
+
 import Char		( ord, chr )
 \end{code}
 
-- 
GitLab