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 merge requests found
......@@ -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}
......
......@@ -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}
......
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