[commit: packages/process] less-cpp, master: Even less CPP in System.Process (81243af)

git at git.haskell.org git at git.haskell.org
Tue Dec 15 13:34:47 UTC 2015


Repository : ssh://git@git.haskell.org/process

On branches: less-cpp,master
Link       : http://ghc.haskell.org/trac/ghc/changeset/81243afb78e8672c869d4806da5a9c410a346433/process

>---------------------------------------------------------------

commit 81243afb78e8672c869d4806da5a9c410a346433
Author: Michael Snoyman <michael at fpcomplete.com>
Date:   Mon Nov 2 17:13:56 2015 +0000

    Even less CPP in System.Process


>---------------------------------------------------------------

81243afb78e8672c869d4806da5a9c410a346433
 System/Process.hsc        | 13 ++++---------
 System/Process/Windows.hs |  1 +
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/System/Process.hsc b/System/Process.hsc
index de07225..0673ca5 100644
--- a/System/Process.hsc
+++ b/System/Process.hsc
@@ -87,12 +87,9 @@ import System.Exit      ( ExitCode(..) )
 import System.IO
 import System.IO.Error (mkIOError, ioeSetErrorString)
 
-#if defined(mingw32_HOST_OS)
-# include <fcntl.h>     /* for _O_BINARY */
-#else
-#if MIN_VERSION_base(4,5,0)
-import System.Posix.Types
-#endif
+-- Provide the data constructors for CPid on GHC 7.4 and later
+#if !defined(WINDOWS) && MIN_VERSION_base(4,5,0)
+import System.Posix.Types (CPid (..))
 #endif
 
 #ifdef __GLASGOW_HASKELL__
@@ -887,9 +884,7 @@ rawSystem :: String -> [String] -> IO ExitCode
 rawSystem cmd args = do
   (_,_,_,p) <- createProcess_ "rawSystem" (proc cmd args) { delegate_ctlc = True }
   waitForProcess p
-#elif !mingw32_HOST_OS
--- crude fallback implementation: could do much better than this under Unix
-rawSystem cmd args = system (showCommandForUser cmd args)
 #else
+-- crude fallback implementation: could do much better than this under Unix
 rawSystem cmd args = system (showCommandForUser cmd args)
 #endif
diff --git a/System/Process/Windows.hs b/System/Process/Windows.hs
index 51a4c51..4c1d7ce 100644
--- a/System/Process/Windows.hs
+++ b/System/Process/Windows.hs
@@ -40,6 +40,7 @@ import System.Environment       ( getEnv )
 import System.FilePath
 import System.Win32.Console (generateConsoleCtrlEvent, cTRL_BREAK_EVENT)
 import System.Win32.Process (getProcessId)
+# include <fcntl.h>     /* for _O_BINARY */
 
 import System.Process.Common
 



More information about the ghc-commits mailing list