diff options
author | Andreas Klebinger <klebinger.andreas@gmx.at> | 2020-06-17 08:55:35 -0400 |
---|---|---|
committer | Andreas Klebinger <klebinger.andreas@gmx.at> | 2020-06-17 10:13:24 -0400 |
commit | 15f4fe32b5104157bbdc7104b9fcf18ab5ff140d (patch) | |
tree | b8f466dc77bf496990ea969906abf81fa6e6b41e | |
parent | 4d803fcee36002473e80cdd8512a34f5e5ccad6c (diff) | |
download | haskell-15f4fe32b5104157bbdc7104b9fcf18ab5ff140d.tar.gz |
wio: Don't mention windows specific functions when building on Linux.
-rw-r--r-- | libraries/base/GHC/IO/SmartHandles.hs | 25 | ||||
-rw-r--r-- | libraries/base/base.cabal | 2 |
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 16b55f87f9..8f493b835a 100644 --- a/libraries/base/base.cabal +++ b/libraries/base/base.cabal @@ -252,7 +252,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 @@ -409,6 +408,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 |