Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
dd6fe036
Commit
dd6fe036
authored
Jun 23, 2003
by
simonmar
Browse files
[project @ 2003-06-23 10:13:03 by simonmar]
openFileEx can't be gotten from GHC.Handle any more.
parent
1f861358
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/utils/Binary.hs
View file @
dd6fe036
...
@@ -96,7 +96,18 @@ import GHC.Real ( Ratio(..) )
...
@@ -96,7 +96,18 @@ import GHC.Real ( Ratio(..) )
import
GHC.Exts
import
GHC.Exts
import
GHC.IOBase
(
IO
(
..
)
)
import
GHC.IOBase
(
IO
(
..
)
)
import
GHC.Word
(
Word8
(
..
)
)
import
GHC.Word
(
Word8
(
..
)
)
#
endif
#
if
__GLASGOW_HASKELL__
<
601
-- openFileEx is available from the lang package, but we want to
-- be independent of hslibs libraries.
import
GHC.Handle
(
openFileEx
,
IOModeEx
(
..
)
)
import
GHC.Handle
(
openFileEx
,
IOModeEx
(
..
)
)
#
else
import
System.IO
(
openBinaryFile
)
#
endif
#
if
__GLASGOW_HASKELL__
<
601
openBinaryFile
f
mode
=
openFileEx
f
(
BinaryMode
mode
)
#
endif
#
endif
#
if
__GLASGOW_HASKELL__
<
503
#
if
__GLASGOW_HASKELL__
<
503
...
@@ -226,7 +237,7 @@ isEOFBin (BinIO _ ix_r h) = hIsEOF h
...
@@ -226,7 +237,7 @@ isEOFBin (BinIO _ ix_r h) = hIsEOF h
writeBinMem
::
BinHandle
->
FilePath
->
IO
()
writeBinMem
::
BinHandle
->
FilePath
->
IO
()
writeBinMem
(
BinIO
_
_
_
)
_
=
error
"Data.Binary.writeBinMem: not a memory handle"
writeBinMem
(
BinIO
_
_
_
)
_
=
error
"Data.Binary.writeBinMem: not a memory handle"
writeBinMem
(
BinMem
_
ix_r
sz_r
arr_r
)
fn
=
do
writeBinMem
(
BinMem
_
ix_r
sz_r
arr_r
)
fn
=
do
h
<-
openFile
Ex
fn
(
BinaryMode
WriteMode
)
h
<-
open
Binary
File
fn
WriteMode
arr
<-
readIORef
arr_r
arr
<-
readIORef
arr_r
ix
<-
readFastMutInt
ix_r
ix
<-
readFastMutInt
ix_r
hPutArray
h
arr
ix
hPutArray
h
arr
ix
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment