diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2016-01-30 23:14:23 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2016-01-31 00:19:53 +0100 |
commit | 2a49ad87b7b5d92bf62035d410c4bcde817d30a6 (patch) | |
tree | 6cba2a97efac7cea6153e6dd10bdc04cd6e669c6 /System/Posix/Temp.hsc | |
parent | 716eccb11f324abc120c24ce0344b7094f1aa435 (diff) |
Drop redundant __GLASGOW_HASKELL__ conditionals for GHC>=7.4
Diffstat (limited to 'System/Posix/Temp.hsc')
-rw-r--r-- | System/Posix/Temp.hsc | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/System/Posix/Temp.hsc b/System/Posix/Temp.hsc index 2d7ca52..473364c 100644 --- a/System/Posix/Temp.hsc +++ b/System/Posix/Temp.hsc @@ -1,6 +1,6 @@ #if __GLASGOW_HASKELL__ >= 709 {-# LANGUAGE Safe #-} -#elif __GLASGOW_HASKELL__ >= 703 +#else {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- @@ -33,10 +33,8 @@ import System.Posix.IO import System.Posix.Types import System.Posix.Internals (withFilePath, peekFilePath) -#if defined(__GLASGOW_HASKELL__) foreign import ccall unsafe "HsUnix.h __hscore_mkstemp" c_mkstemp :: CString -> IO CInt -#endif -- | Make a unique filename and open it for reading\/writing. The returned -- 'FilePath' is the (possibly relative) path of the created file, which is @@ -48,17 +46,11 @@ foreign import ccall unsafe "HsUnix.h __hscore_mkstemp" mkstemp :: String -> IO (FilePath, Handle) mkstemp template' = do let template = template' ++ "XXXXXX" -#if defined(__GLASGOW_HASKELL__) withFilePath template $ \ ptr -> do fd <- throwErrnoIfMinus1 "mkstemp" (c_mkstemp ptr) name <- peekFilePath ptr h <- fdToHandle (Fd fd) return (name, h) -#else - name <- mktemp template - h <- openFile name ReadWriteMode - return (name, h) -#endif #if HAVE_MKSTEMPS foreign import ccall unsafe "HsUnix.h __hscore_mkstemps" @@ -114,7 +106,7 @@ mkdtemp template' = do return name #endif -#if !defined(__GLASGOW_HASKELL__) || !HAVE_MKDTEMP +#if !HAVE_MKDTEMP foreign import ccall unsafe "mktemp" c_mktemp :: CString -> IO CString |