Skip to content

Commit

Permalink
WINIO: Add support for WINIO to Cabal.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mistuke committed May 25, 2020
1 parent b744cde commit 8252951
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Cabal/Distribution/Compat/Internal/TempFile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ import qualified System.Posix
-- needs to be changed to make this better.
openNewBinaryFile :: FilePath -> String -> IO (FilePath, Handle)
openNewBinaryFile dir template = do
-- This method can't be used under WINIO. Also the current implementation has
-- thread safety issues depending on which GHC is used. On newer GHC's let's
-- use the built in one.
#if defined(__IO_MANAGER_WINIO__)
openBinaryTempFile dir template
#else
pid <- c_getpid
findTempName pid
where
Expand Down Expand Up @@ -95,6 +101,8 @@ pathSeparator = '\\'
#else
pathSeparator = '/'
#endif
-- /* __IO_MANAGER_WINIO__ */
#endif

-- FIXME: Copied from GHC.Handle
std_flags, output_flags, rw_flags :: CInt
Expand Down

0 comments on commit 8252951

Please sign in to comment.