diff options
author | Andreas Klebinger <klebinger.andreas@gmx.at> | 2020-06-17 08:55:35 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-07-15 16:41:03 -0400 |
commit | f8d39a510c563271e26ec7175b8e538d0b6809da (patch) | |
tree | e8ca807c792a9278adf2af8ed73acce797f7bd7b /libraries | |
parent | b59430c00f41e18386bc44540180451169f6b9d7 (diff) | |
download | haskell-f8d39a510c563271e26ec7175b8e538d0b6809da.tar.gz |
winio: Don't mention windows specific functions when building on Linux.
Diffstat (limited to 'libraries')
-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 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 |