Commit 1751d7be authored by Ian Lynagh's avatar Ian Lynagh

Fix readwrite00[12] on Windows

parent 1a11db60
...@@ -5,7 +5,7 @@ module Main(main) where ...@@ -5,7 +5,7 @@ module Main(main) where
import IO import IO
import Directory ( removeFile, doesFileExist ) import Directory ( removeFile, doesFileExist )
import Monad import Monad
#ifdef i386_unknown_mingw32 #ifdef mingw32_HOST_OS
import GHC.Handle(hSetBinaryMode) import GHC.Handle(hSetBinaryMode)
#endif #endif
...@@ -13,7 +13,7 @@ main = do ...@@ -13,7 +13,7 @@ main = do
f <- doesFileExist "readwrite001.inout" f <- doesFileExist "readwrite001.inout"
when f (removeFile "readwrite001.inout") when f (removeFile "readwrite001.inout")
hdl <- openFile "readwrite001.inout" ReadWriteMode hdl <- openFile "readwrite001.inout" ReadWriteMode
#ifdef i386_unknown_mingw32 #ifdef mingw32_HOST_OS
hSetBinaryMode hdl True hSetBinaryMode hdl True
#endif #endif
hSetBuffering hdl LineBuffering hSetBuffering hdl LineBuffering
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import IO import IO
import Directory (removeFile, doesFileExist) import Directory (removeFile, doesFileExist)
import Monad import Monad
#ifdef i386_unknown_mingw32 #ifdef mingw32_HOST_OS
import GHC.Handle(hSetBinaryMode) import GHC.Handle(hSetBinaryMode)
#endif #endif
...@@ -15,7 +15,7 @@ main = do ...@@ -15,7 +15,7 @@ main = do
f <- doesFileExist username f <- doesFileExist username
when f (removeFile username) when f (removeFile username)
cd <- openFile username ReadWriteMode cd <- openFile username ReadWriteMode
#ifdef i386_unknown_mingw32 #ifdef mingw32_HOST_OS
hSetBinaryMode cd True hSetBinaryMode cd True
#endif #endif
hSetBuffering stdin NoBuffering hSetBuffering stdin NoBuffering
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment