[Git][ghc/ghc][wip/andreask/wio/fix_linux] 3 commits: wio: Don't mention windows specific functions when building on Linux.

Andreas Klebinger gitlab at gitlab.haskell.org
Thu Jun 18 14:41:31 UTC 2020



Andreas Klebinger pushed to branch wip/andreask/wio/fix_linux at Glasgow Haskell Compiler / GHC


Commits:
15f4fe32 by Andreas Klebinger at 2020-06-17T10:13:24-04:00
wio: Don't mention windows specific functions when building on Linux.

- - - - -
40a3679c by Tamar Christina at 2020-06-17T14:42:26-04:00
Merge branch 'wip/andreask/wio/fix_linux' into 'io-manager-simple-split'

Fix linux build

See merge request Phyx/ghc!11
- - - - -
f0282dbf by Andreas Klebinger at 2020-06-18T10:20:14-04:00
Fix linux validate build

- - - - -


4 changed files:

- libraries/base/GHC/Event/TimerManager.hs
- libraries/base/GHC/IO/SmartHandles.hs
- libraries/base/GHC/IO/SubSystem.hs
- libraries/base/base.cabal


Changes:

=====================================
libraries/base/GHC/Event/TimerManager.hs
=====================================
@@ -51,7 +51,7 @@ import GHC.Real (quot, fromIntegral)
 import GHC.Show (Show(..))
 import GHC.Event.Control
 import GHC.Event.Internal (Backend, Event, evtRead, Timeout(..))
-import GHC.Event.Unique (Unique, UniqueSource, newSource, newUnique)
+import GHC.Event.Unique (UniqueSource, newSource, newUnique)
 import GHC.Event.TimeOut
 import System.Posix.Types (Fd)
 


=====================================
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


=====================================
libraries/base/GHC/IO/SubSystem.hs
=====================================
@@ -29,9 +29,11 @@ module GHC.IO.SubSystem (
  ) where
 
 import GHC.Base
+import GHC.RTS.Flags
 
+#if defined(mingw32_HOST_OS)
 import GHC.IO.Unsafe
-import GHC.RTS.Flags
+#endif
 
 infixl 7 <!>
 


=====================================
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



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d143353339619e45aacd498334b1970bbb443b51...f0282dbfe7666127480852bb72fcbac9a3a1a265

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d143353339619e45aacd498334b1970bbb443b51...f0282dbfe7666127480852bb72fcbac9a3a1a265
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200618/b09d687a/attachment-0001.html>


More information about the ghc-commits mailing list