aboutsummaryrefslogtreecommitdiff
path: root/src/Binary.hs
diff options
context:
space:
mode:
authorpanne <unknown>2002-06-23 14:54:00 +0000
committerpanne <unknown>2002-06-23 14:54:00 +0000
commitd3640a19b8a26ed07cfd463ae948925052c2ec2a (patch)
treec0545e62436fdeb1e580a410ca93bf91a07a7739 /src/Binary.hs
parent4831dbbdd3d9899efdd07093507ae7bf08209289 (diff)
[haddock @ 2002-06-23 14:54:00 by panne]
Make it compile with newer GHCs
Diffstat (limited to 'src/Binary.hs')
-rw-r--r--src/Binary.hs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/Binary.hs b/src/Binary.hs
index 9d1d11af..9a632089 100644
--- a/src/Binary.hs
+++ b/src/Binary.hs
@@ -66,19 +66,25 @@ import Exception
import GlaExts hiding (ByteArray, newByteArray, freezeByteArray)
import Array
import IO
+#if __GLASGOW_HASKELL__ < 503
import PrelIOBase -- ( IOError(..), IOErrorType(..) )
import PrelReal -- ( Ratio(..) )
import PrelIOBase -- ( IO(..) )
-import MArray (IOUArray)
+#else
+import System.IO.Error ( mkIOError, eofErrorType )
+import GHC.Real ( Ratio(..) )
+import GHC.IOBase ( IO(..) )
+#endif
type BinArray = MutableByteArray RealWorld Int
newArray_ bounds = stToIO (newCharArray bounds)
unsafeWrite arr ix e = stToIO (writeWord8Array arr ix e)
unsafeRead arr ix = stToIO (readWord8Array arr ix)
-hPutArray h arr sz = hPutBufBAFull h arr sz
-hGetArray h sz = hGetBufBAFull h sz
+hPutArray h arr sz = hPutBufBA h arr sz
+hGetArray h sz = hGetBufBA h sz
+#if __GLASGOW_HASKELL__ < 503
mkIOError :: IOErrorType -> String -> Maybe Handle -> Maybe FilePath -> Exception
mkIOError t location maybe_hdl maybe_filename
= IOException (IOError maybe_hdl t location ""
@@ -86,6 +92,7 @@ mkIOError t location maybe_hdl maybe_filename
)
eofErrorType = EOF
+#endif
#ifndef SIZEOF_HSINT
#define SIZEOF_HSINT INT_SIZE_IN_BYTES