summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'libraries')
-rw-r--r--libraries/base/GHC/IO/SmartHandles.hs25
-rw-r--r--libraries/base/base.cabal2
2 files changed, 24 insertions, 3 deletions
diff --git a/libraries/base/GHC/IO/SmartHandles.hs b/libraries/base/GHC/IO/SmartHandles.hs
index 10e1488b0f..3b38212d32 100644
--- a/libraries/base/GHC/IO/SmartHandles.hs
+++ b/libraries/base/GHC/IO/SmartHandles.hs
@@ -25,13 +25,12 @@ module GHC.IO.SmartHandles
import GHC.IO
import GHC.IO.IOMode
-import GHC.IO.SubSystem
import GHC.IO.Handle.Types
import qualified GHC.IO.Handle.FD as POSIX
#if defined(mingw32_HOST_OS)
+import GHC.IO.SubSystem
import qualified GHC.IO.Handle.Windows as Win
-#endif
stdin :: Handle
stdin = POSIX.stdin <!> Win.stdin
@@ -50,3 +49,25 @@ openBinaryFile = POSIX.openBinaryFile <!> Win.openBinaryFile
openFileBlocking :: FilePath -> IOMode -> IO Handle
openFileBlocking = POSIX.openFileBlocking <!> Win.openFileBlocking
+
+#else
+
+stdin :: Handle
+stdin = POSIX.stdin
+
+stdout :: Handle
+stdout = POSIX.stdout
+
+stderr :: Handle
+stderr = POSIX.stderr
+
+openFile :: FilePath -> IOMode -> IO Handle
+openFile = POSIX.openFile
+
+openBinaryFile :: FilePath -> IOMode -> IO Handle
+openBinaryFile = POSIX.openBinaryFile
+
+openFileBlocking :: FilePath -> IOMode -> IO Handle
+openFileBlocking = POSIX.openFileBlocking
+
+#endif
diff --git a/libraries/base/base.cabal b/libraries/base/base.cabal
index 8d25c08dab..164ba84ef5 100644
--- a/libraries/base/base.cabal
+++ b/libraries/base/base.cabal
@@ -234,7 +234,6 @@ Library
GHC.IO.FD
GHC.IO.Handle
GHC.IO.Handle.FD
- GHC.IO.Handle.Windows
GHC.IO.Handle.Internals
GHC.IO.Handle.Lock
GHC.IO.Handle.Text
@@ -398,6 +397,7 @@ Library
GHC.Event.Windows.FFI
GHC.Event.Windows.ManagedThreadPool
GHC.Event.Windows.Thread
+ GHC.IO.Handle.Windows
GHC.IO.Windows.Handle
GHC.IO.Windows.Encoding
GHC.IO.Windows.Paths