Skip to content
Snippets Groups Projects
Commit 0de2926c authored by sof's avatar sof
Browse files

[project @ 1997-10-21 20:33:36 by sof]

Avoid exposing ForeignObjs when compiling Parallel Haskell
parent 4299243f
No related branches found
No related tags found
No related merge requests found
...@@ -34,10 +34,12 @@ module PackBase ...@@ -34,10 +34,12 @@ module PackBase
unpackCStringBA#, -- :: ByteArray# -> Int# -> [Char] unpackCStringBA#, -- :: ByteArray# -> Int# -> [Char]
unpackNBytesBA#, -- :: ByteArray# -> Int# -> [Char] unpackNBytesBA#, -- :: ByteArray# -> Int# -> [Char]
#ifndef __PARALLEL_HASKELL__
unpackCStringFO, -- :: ForeignObj -> [Char] unpackCStringFO, -- :: ForeignObj -> [Char]
unpackNBytesFO, -- :: ForeignObj -> Int -> [Char] unpackNBytesFO, -- :: ForeignObj -> Int -> [Char]
unpackCStringFO#, -- :: ForeignObj# -> [Char] unpackCStringFO#, -- :: ForeignObj# -> [Char]
unpackNBytesFO#, -- :: ForeignObj# -> Int# -> [Char] unpackNBytesFO#, -- :: ForeignObj# -> Int# -> [Char]
#endif
unpackFoldrCString#, -- ** unpackFoldrCString#, -- **
unpackAppendCString# -- ** unpackAppendCString# -- **
...@@ -121,6 +123,7 @@ sequence of bytes into a list of @Char@s (a renamed version ...@@ -121,6 +123,7 @@ sequence of bytes into a list of @Char@s (a renamed version
of the code above). of the code above).
\begin{code} \begin{code}
#ifndef __PARALLEL_HASKELL__
unpackCStringFO :: ForeignObj -> [Char] unpackCStringFO :: ForeignObj -> [Char]
unpackCStringFO (ForeignObj fo#) = unpackCStringFO# fo# unpackCStringFO (ForeignObj fo#) = unpackCStringFO# fo#
...@@ -147,6 +150,7 @@ unpackNBytesFO# fo len ...@@ -147,6 +150,7 @@ unpackNBytesFO# fo len
| otherwise = C# ch : unpack (i +# 1#) | otherwise = C# ch : unpack (i +# 1#)
where where
ch = indexCharOffForeignObj# fo i ch = indexCharOffForeignObj# fo i
#endif
\end{code} \end{code}
......
...@@ -41,7 +41,12 @@ import IOHandle -- much of the real stuff is in here ...@@ -41,7 +41,12 @@ import IOHandle -- much of the real stuff is in here
import PackBase ( unpackNBytesST ) import PackBase ( unpackNBytesST )
import PrelBase import PrelBase
import GHC import GHC
import Foreign ( ForeignObj, Addr, makeForeignObj, writeForeignObj ) import Foreign ( Addr,
#ifndef __PARALLEL_HASKELL__
ForeignObj, makeForeignObj, writeForeignObj
#endif
)
import Char ( ord, chr ) import Char ( ord, chr )
\end{code} \end{code}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment