diff options
40 files changed, 41 insertions, 179 deletions
diff --git a/System/Posix.hs b/System/Posix.hs index 7ad88a2..5c6a503 100644 --- a/System/Posix.hs +++ b/System/Posix.hs @@ -1,4 +1,4 @@ -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Safe #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/ByteString.hs b/System/Posix/ByteString.hs index 7ee8bdb..a9999c9 100644 --- a/System/Posix/ByteString.hs +++ b/System/Posix/ByteString.hs @@ -1,4 +1,4 @@ -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Safe #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/ByteString/FilePath.hsc b/System/Posix/ByteString/FilePath.hsc index f3ecd3c..318cf14 100644 --- a/System/Posix/ByteString/FilePath.hsc +++ b/System/Posix/ByteString/FilePath.hsc @@ -1,4 +1,4 @@ -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/Directory.hsc b/System/Posix/Directory.hsc index 870795b..71a70ce 100644 --- a/System/Posix/Directory.hsc +++ b/System/Posix/Directory.hsc @@ -1,6 +1,6 @@ {-# LANGUAGE ForeignFunctionInterface #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif @@ -45,21 +45,7 @@ import Foreign import Foreign.C import System.Posix.Directory.Common - -#if __GLASGOW_HASKELL__ > 700 import System.Posix.Internals (withFilePath, peekFilePath) -#elif __GLASGOW_HASKELL__ > 611 -import System.Posix.Internals (withFilePath) - -peekFilePath :: CString -> IO FilePath -peekFilePath = peekCString -#else -withFilePath :: FilePath -> (CString -> IO a) -> IO a -withFilePath = withCString - -peekFilePath :: CString -> IO FilePath -peekFilePath = peekCString -#endif -- | @createDirectory dir mode@ calls @mkdir@ to -- create a new directory, @dir@, with permissions based on diff --git a/System/Posix/Directory/ByteString.hsc b/System/Posix/Directory/ByteString.hsc index 9159d05..3ac642b 100644 --- a/System/Posix/Directory/ByteString.hsc +++ b/System/Posix/Directory/ByteString.hsc @@ -1,6 +1,6 @@ {-# LANGUAGE ForeignFunctionInterface #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif diff --git a/System/Posix/Directory/Common.hsc b/System/Posix/Directory/Common.hsc index 9b49357..a608be3 100644 --- a/System/Posix/Directory/Common.hsc +++ b/System/Posix/Directory/Common.hsc @@ -1,6 +1,6 @@ {-# LANGUAGE ForeignFunctionInterface #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif diff --git a/System/Posix/DynamicLinker.hsc b/System/Posix/DynamicLinker.hsc index 7683fc3..5398f03 100644 --- a/System/Posix/DynamicLinker.hsc +++ b/System/Posix/DynamicLinker.hsc @@ -1,4 +1,4 @@ -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- @@ -56,12 +56,7 @@ import System.Posix.DynamicLinker.Prim import Control.Exception ( bracket ) import Control.Monad ( liftM ) import Foreign -#if __GLASGOW_HASKELL__ > 611 import System.Posix.Internals ( withFilePath ) -#else -withFilePath :: FilePath -> (CString -> IO a) -> IO a -withFilePath = withCString -#endif dlopen :: FilePath -> [RTLDFlags] -> IO DL dlopen path flags = do diff --git a/System/Posix/DynamicLinker/ByteString.hsc b/System/Posix/DynamicLinker/ByteString.hsc index 6525eb9..2e9a6b0 100644 --- a/System/Posix/DynamicLinker/ByteString.hsc +++ b/System/Posix/DynamicLinker/ByteString.hsc @@ -1,4 +1,4 @@ -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/DynamicLinker/Common.hsc b/System/Posix/DynamicLinker/Common.hsc index 2b5e0d9..8e1321d 100644 --- a/System/Posix/DynamicLinker/Common.hsc +++ b/System/Posix/DynamicLinker/Common.hsc @@ -1,4 +1,4 @@ -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/DynamicLinker/Module.hsc b/System/Posix/DynamicLinker/Module.hsc index 2e5d6fe..f54a7c6 100644 --- a/System/Posix/DynamicLinker/Module.hsc +++ b/System/Posix/DynamicLinker/Module.hsc @@ -1,5 +1,5 @@ {-# LANGUAGE ForeignFunctionInterface #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- @@ -62,14 +62,7 @@ where import System.Posix.DynamicLinker import System.Posix.DynamicLinker.Common import Foreign.Ptr ( Ptr, nullPtr, FunPtr ) -#if __GLASGOW_HASKELL__ > 611 import System.Posix.Internals ( withFilePath ) -#else -import Foreign.C.String ( withCString ) - -withFilePath :: FilePath -> (CString -> IO a) -> IO a -withFilePath = withCString -#endif unModule :: Module -> (Ptr ()) unModule (Module adr) = adr diff --git a/System/Posix/DynamicLinker/Module/ByteString.hsc b/System/Posix/DynamicLinker/Module/ByteString.hsc index 59f45e2..3921d85 100644 --- a/System/Posix/DynamicLinker/Module/ByteString.hsc +++ b/System/Posix/DynamicLinker/Module/ByteString.hsc @@ -1,5 +1,5 @@ {-# LANGUAGE ForeignFunctionInterface #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/DynamicLinker/Prim.hsc b/System/Posix/DynamicLinker/Prim.hsc index 9a21d77..ec933fb 100644 --- a/System/Posix/DynamicLinker/Prim.hsc +++ b/System/Posix/DynamicLinker/Prim.hsc @@ -1,5 +1,5 @@ {-# LANGUAGE ForeignFunctionInterface #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/Env.hsc b/System/Posix/Env.hsc index be4711b..ecc6281 100644 --- a/System/Posix/Env.hsc +++ b/System/Posix/Env.hsc @@ -1,5 +1,5 @@ {-# LANGUAGE ForeignFunctionInterface #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- @@ -38,20 +38,7 @@ import Foreign.Ptr import Foreign.Storable import Control.Monad import Data.Maybe (fromMaybe) -#if __GLASGOW_HASKELL__ > 700 import System.Posix.Internals (withFilePath, peekFilePath) -#elif __GLASGOW_HASKELL__ > 611 -import System.Posix.Internals (withFilePath) - -peekFilePath :: CString -> IO FilePath -peekFilePath = peekCString -#else -withFilePath :: FilePath -> (CString -> IO a) -> IO a -withFilePath = withCString - -peekFilePath :: CString -> IO FilePath -peekFilePath = peekCString -#endif -- |'getEnv' looks up a variable in the environment. diff --git a/System/Posix/Env/ByteString.hsc b/System/Posix/Env/ByteString.hsc index 70b3f73..7fdb710 100644 --- a/System/Posix/Env/ByteString.hsc +++ b/System/Posix/Env/ByteString.hsc @@ -1,5 +1,5 @@ {-# LANGUAGE ForeignFunctionInterface #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/Error.hs b/System/Posix/Error.hs index 7c68941..ca66fa9 100644 --- a/System/Posix/Error.hs +++ b/System/Posix/Error.hs @@ -1,4 +1,4 @@ -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/Files.hsc b/System/Posix/Files.hsc index 6849a9b..d9b12ad 100644 --- a/System/Posix/Files.hsc +++ b/System/Posix/Files.hsc @@ -1,6 +1,6 @@ {-# LANGUAGE ForeignFunctionInterface #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- @@ -101,26 +101,7 @@ import System.Posix.Types import System.Posix.Internals import System.Posix.Files.Common -#if __GLASGOW_HASKELL__ > 700 import System.Posix.Internals (withFilePath, peekFilePath) -#elif __GLASGOW_HASKELL__ > 611 -import System.Posix.Internals (withFilePath) - -peekFilePath :: CString -> IO FilePath -peekFilePath = peekCString - -peekFilePathLen :: CStringLen -> IO FilePath -peekFilePathLen = peekCStringLen -#else -withFilePath :: FilePath -> (CString -> IO a) -> IO a -withFilePath = withCString - -peekFilePath :: CString -> IO FilePath -peekFilePath = peekCString - -peekFilePathLen :: CStringLen -> IO FilePath -peekFilePathLen = peekCStringLen -#endif import Data.Time.Clock.POSIX diff --git a/System/Posix/Files/ByteString.hsc b/System/Posix/Files/ByteString.hsc index d641fb9..b25a823 100644 --- a/System/Posix/Files/ByteString.hsc +++ b/System/Posix/Files/ByteString.hsc @@ -1,4 +1,4 @@ -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/Files/Common.hsc b/System/Posix/Files/Common.hsc index 44d66e8..04a0d91 100644 --- a/System/Posix/Files/Common.hsc +++ b/System/Posix/Files/Common.hsc @@ -1,6 +1,6 @@ {-# LANGUAGE ForeignFunctionInterface #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/IO.hsc b/System/Posix/IO.hsc index c5b8e55..ba0e690 100644 --- a/System/Posix/IO.hsc +++ b/System/Posix/IO.hsc @@ -1,7 +1,7 @@ {-# LANGUAGE ForeignFunctionInterface #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -XRecordWildCards #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- @@ -71,13 +71,7 @@ module System.Posix.IO ( import System.Posix.Types import System.Posix.Error import System.Posix.IO.Common - -#if __GLASGOW_HASKELL__ > 611 import System.Posix.Internals ( withFilePath ) -#else -withFilePath :: FilePath -> (CString -> IO a) -> IO a -withFilePath = withCString -#endif -- |Open and optionally create this file. See 'System.Posix.Files' -- for information on how to use the 'FileMode' type. diff --git a/System/Posix/IO/ByteString.hsc b/System/Posix/IO/ByteString.hsc index 518a2ec..da8e65b 100644 --- a/System/Posix/IO/ByteString.hsc +++ b/System/Posix/IO/ByteString.hsc @@ -1,7 +1,7 @@ {-# LANGUAGE ForeignFunctionInterface #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -XRecordWildCards #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/IO/Common.hsc b/System/Posix/IO/Common.hsc index e12bebc..366ccf8 100644 --- a/System/Posix/IO/Common.hsc +++ b/System/Posix/IO/Common.hsc @@ -1,7 +1,7 @@ {-# LANGUAGE ForeignFunctionInterface #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} {-# OPTIONS_GHC -XRecordWildCards #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- @@ -72,7 +72,6 @@ import Foreign.C import Data.Bits #ifdef __GLASGOW_HASKELL__ -#if __GLASGOW_HASKELL__ >= 611 import GHC.IO.Handle import GHC.IO.Handle.Internals import GHC.IO.Handle.Types @@ -80,11 +79,6 @@ import qualified GHC.IO.FD as FD import qualified GHC.IO.Handle.FD as FD import GHC.IO.Exception import Data.Typeable (cast) -#else -import GHC.IOBase -import GHC.Handle hiding (fdToHandle) -import qualified GHC.Handle -#endif #endif #ifdef __HUGS__ @@ -226,7 +220,6 @@ handleToFd :: Handle -> IO Fd fdToHandle :: Fd -> IO Handle #ifdef __GLASGOW_HASKELL__ -#if __GLASGOW_HASKELL__ >= 611 handleToFd h@(FileHandle _ m) = do withHandle' "handleToFd" h m $ handleToFd' h handleToFd h@(DuplexHandle _ r w) = do @@ -251,23 +244,6 @@ handleToFd' h h_@Handle__{haType=_,..} = do return (Handle__{haType=ClosedHandle,..}, Fd (FD.fdFD fd)) fdToHandle fd = FD.fdToHandle (fromIntegral fd) - -#else - -handleToFd h = withHandle "handleToFd" h $ \ h_ -> do - -- converting a Handle into an Fd effectively means - -- letting go of the Handle; it is put into a closed - -- state as a result. - let fd = haFD h_ - flushWriteBufferOnly h_ - unlockFile (fromIntegral fd) - -- setting the Handle's fd to (-1) as well as its 'type' - -- to closed, is enough to disable the finalizer that - -- eventually is run on the Handle. - return (h_{haFD= (-1),haType=ClosedHandle}, Fd (fromIntegral fd)) - -fdToHandle fd = GHC.Handle.fdToHandle (fromIntegral fd) -#endif #endif #ifdef __HUGS__ diff --git a/System/Posix/Process.hsc b/System/Posix/Process.hsc index 9b1d72f..4651e65 100644 --- a/System/Posix/Process.hsc +++ b/System/Posix/Process.hsc @@ -1,5 +1,5 @@ {-# LANGUAGE ForeignFunctionInterface #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- @@ -74,13 +74,7 @@ import Foreign import Foreign.C import System.Posix.Process.Internals import System.Posix.Process.Common - -#if __GLASGOW_HASKELL__ > 611 import System.Posix.Internals ( withFilePath ) -#else -withFilePath :: FilePath -> (CString -> IO a) -> IO a -withFilePath = withCString -#endif #ifdef __HUGS__ {-# CFILES cbits/HsUnix.c #-} diff --git a/System/Posix/Process/ByteString.hsc b/System/Posix/Process/ByteString.hsc index e7b902e..2be1fcd 100644 --- a/System/Posix/Process/ByteString.hsc +++ b/System/Posix/Process/ByteString.hsc @@ -1,5 +1,5 @@ {-# LANGUAGE ForeignFunctionInterface #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/Process/Common.hsc b/System/Posix/Process/Common.hsc index 790f55b..5a1bed3 100644 --- a/System/Posix/Process/Common.hsc +++ b/System/Posix/Process/Common.hsc @@ -1,5 +1,5 @@ {-# LANGUAGE ForeignFunctionInterface #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/Process/Internals.hs b/System/Posix/Process/Internals.hs index a8bd82b..0ff88d8 100644 --- a/System/Posix/Process/Internals.hs +++ b/System/Posix/Process/Internals.hs @@ -1,4 +1,4 @@ -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif diff --git a/System/Posix/Resource.hsc b/System/Posix/Resource.hsc index 6651998..6beab78 100644 --- a/System/Posix/Resource.hsc +++ b/System/Posix/Resource.hsc @@ -1,6 +1,6 @@ {-# LANGUAGE ForeignFunctionInterface #-} {-# OPTIONS_GHC -w #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif -- The above warning supression flag is a temporary kludge. diff --git a/System/Posix/Semaphore.hsc b/System/Posix/Semaphore.hsc index 9ff39f4..503abad 100644 --- a/System/Posix/Semaphore.hsc +++ b/System/Posix/Semaphore.hsc @@ -1,5 +1,5 @@ {-# LANGUAGE ForeignFunctionInterface #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/SharedMem.hsc b/System/Posix/SharedMem.hsc index 8e51568..ee62839 100644 --- a/System/Posix/SharedMem.hsc +++ b/System/Posix/SharedMem.hsc @@ -1,6 +1,6 @@ {-# LANGUAGE ForeignFunctionInterface #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/Signals.hsc b/System/Posix/Signals.hsc index 722cada..da12acd 100644 --- a/System/Posix/Signals.hsc +++ b/System/Posix/Signals.hsc @@ -1,6 +1,6 @@ {-# LANGUAGE DeriveDataTypeable, PatternGuards, CApiFFI #-} {-# OPTIONS_GHC -fno-cse #-} -- global variables -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- @@ -112,11 +112,7 @@ import System.Posix.Process.Internals import Data.Dynamic #ifdef __GLASGOW_HASKELL__ -#if __GLASGOW_HASKELL__ >= 611 ##include "rts/Signals.h" -#else -##include "Signals.h" -#endif import GHC.Conc hiding (Signal) #endif diff --git a/System/Posix/Signals/Exts.hsc b/System/Posix/Signals/Exts.hsc index 5dece59..cb62cb5 100644 --- a/System/Posix/Signals/Exts.hsc +++ b/System/Posix/Signals/Exts.hsc @@ -1,5 +1,5 @@ {-# LANGUAGE ForeignFunctionInterface #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/Temp.hsc b/System/Posix/Temp.hsc index e960ea3..5b5cbcc 100644 --- a/System/Posix/Temp.hsc +++ b/System/Posix/Temp.hsc @@ -1,5 +1,5 @@ {-# LANGUAGE ForeignFunctionInterface #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- @@ -30,24 +30,8 @@ import System.Posix.Directory (createDirectory) #endif import System.Posix.IO import System.Posix.Types - -#if __GLASGOW_HASKELL__ > 700 import System.Posix.Internals (withFilePath, peekFilePath) -#elif __GLASGOW_HASKELL__ > 611 -import System.Posix.Internals (withFilePath) - -peekFilePath :: CString -> IO FilePath -peekFilePath = peekCString - -#else -withFilePath :: FilePath -> (CString -> IO a) -> IO a -withFilePath = withCString - -peekFilePath :: CString -> IO FilePath -peekFilePath = peekCString -#endif - #if defined(__GLASGOW_HASKELL__) || defined(__HUGS__) foreign import ccall unsafe "HsUnix.h __hscore_mkstemp" c_mkstemp :: CString -> IO CInt diff --git a/System/Posix/Temp/ByteString.hsc b/System/Posix/Temp/ByteString.hsc index 140d36a..61ab4c0 100644 --- a/System/Posix/Temp/ByteString.hsc +++ b/System/Posix/Temp/ByteString.hsc @@ -1,5 +1,5 @@ {-# LANGUAGE ForeignFunctionInterface #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/Terminal.hsc b/System/Posix/Terminal.hsc index b00c6d6..b5519c6 100644 --- a/System/Posix/Terminal.hsc +++ b/System/Posix/Terminal.hsc @@ -1,6 +1,6 @@ {-# LANGUAGE ForeignFunctionInterface #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- @@ -79,26 +79,7 @@ import System.Posix.Terminal.Common import System.Posix.Types import System.Posix.IO -#if __GLASGOW_HASKELL__ > 700 import System.Posix.Internals (withFilePath, peekFilePath) -#elif __GLASGOW_HASKELL__ > 611 -import System.Posix.Internals (withFilePath) - -peekFilePath :: CString -> IO FilePath -peekFilePath = peekCString - -peekFilePathLen :: CStringLen -> IO FilePath -peekFilePathLen = peekCStringLen -#else -withFilePath :: FilePath -> (CString -> IO a) -> IO a -withFilePath = withCString - -peekFilePath :: CString -> IO FilePath -peekFilePath = peekCString - -peekFilePathLen :: CStringLen -> IO FilePath -peekFilePathLen = peekCStringLen -#endif -- | @getTerminalName fd@ calls @ttyname@ to obtain a name associated -- with the terminal for @Fd@ @fd@. If @fd@ is associated diff --git a/System/Posix/Terminal/ByteString.hsc b/System/Posix/Terminal/ByteString.hsc index 1b1845c..34558fb 100644 --- a/System/Posix/Terminal/ByteString.hsc +++ b/System/Posix/Terminal/ByteString.hsc @@ -1,6 +1,6 @@ {-# LANGUAGE ForeignFunctionInterface #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/Terminal/Common.hsc b/System/Posix/Terminal/Common.hsc index 3a6254d..5d718a8 100644 --- a/System/Posix/Terminal/Common.hsc +++ b/System/Posix/Terminal/Common.hsc @@ -1,6 +1,6 @@ {-# LANGUAGE ForeignFunctionInterface #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/Time.hsc b/System/Posix/Time.hsc index 641b955..a4903fa 100644 --- a/System/Posix/Time.hsc +++ b/System/Posix/Time.hsc @@ -1,5 +1,5 @@ {-# LANGUAGE ForeignFunctionInterface #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/Unistd.hsc b/System/Posix/Unistd.hsc index dfd2673..87974ff 100644 --- a/System/Posix/Unistd.hsc +++ b/System/Posix/Unistd.hsc @@ -1,6 +1,6 @@ {-# LANGUAGE ForeignFunctionInterface #-} {-# OPTIONS_GHC -fno-warn-unused-imports -fno-warn-unused-binds #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/System/Posix/User.hsc b/System/Posix/User.hsc index 71d2ea0..a62648d 100644 --- a/System/Posix/User.hsc +++ b/System/Posix/User.hsc @@ -1,5 +1,5 @@ {-# LANGUAGE ForeignFunctionInterface #-} -#if __GLASGOW_HASKELL__ >= 701 +#ifdef __GLASGOW_HASKELL__ {-# LANGUAGE Trustworthy #-} #endif ----------------------------------------------------------------------------- diff --git a/tests/signals001.hs b/tests/signals001.hs index e278550..fdad7a9 100644 --- a/tests/signals001.hs +++ b/tests/signals001.hs @@ -1,10 +1,6 @@ import System.Posix.Signals -#if __GLASGOW_HASKELL__ >= 603 #include "ghcconfig.h" -#else -#include "config.h" -#endif main = do print (testMembers emptySignalSet) @@ -78,12 +78,11 @@ Library System.Posix.Process.Common System.Posix.Terminal.Common - build-depends: base >= 4.2 && < 4.8, + build-depends: base >= 4.5 && < 4.8, bytestring >= 0.9.2.0 && < 0.11, time - extensions: CPP, ForeignFunctionInterface, EmptyDataDecls - if impl(ghc >= 7.1) - extensions: NondecreasingIndentation + extensions: CPP, ForeignFunctionInterface, EmptyDataDecls, + NondecreasingIndentation include-dirs: include includes: HsUnix.h execvpe.h install-includes: |