From 716eccb11f324abc120c24ce0344b7094f1aa435 Mon Sep 17 00:00:00 2001 From: Herbert Valerio Riedel Date: Sat, 30 Jan 2016 22:55:06 +0100 Subject: Drop bitrotting HUGS support It's very unlikely the current `unix` code stands any chance of even remotely work with Hugs... --- System/Posix/IO/Common.hsc | 15 --------------- System/Posix/Process.hsc | 4 ---- System/Posix/Process/ByteString.hsc | 4 ---- System/Posix/Process/Common.hsc | 4 ---- System/Posix/Signals.hsc | 13 ++----------- System/Posix/Temp.hsc | 6 +++--- System/Posix/Temp/ByteString.hsc | 6 +++--- 7 files changed, 8 insertions(+), 44 deletions(-) diff --git a/System/Posix/IO/Common.hsc b/System/Posix/IO/Common.hsc index eb4a721..abcd19b 100644 --- a/System/Posix/IO/Common.hsc +++ b/System/Posix/IO/Common.hsc @@ -79,11 +79,6 @@ import GHC.IO.Exception import Data.Typeable (cast) #endif -#ifdef __HUGS__ -import Hugs.Prelude (IOException(..), IOErrorType(..)) -import qualified Hugs.IO (handleToFd, openFd) -#endif - #include "HsUnix.h" -- ----------------------------------------------------------------------------- @@ -239,16 +234,6 @@ handleToFd' h h_@Handle__{haType=_,..} = do fdToHandle fd = FD.fdToHandle (fromIntegral fd) #endif -#ifdef __HUGS__ -handleToFd h = do - fd <- Hugs.IO.handleToFd h - return (fromIntegral fd) - -fdToHandle fd = do - mode <- fdGetMode (fromIntegral fd) - Hugs.IO.openFd (fromIntegral fd) False mode True -#endif - -- ----------------------------------------------------------------------------- -- Fd options diff --git a/System/Posix/Process.hsc b/System/Posix/Process.hsc index 42426a3..72da1c6 100644 --- a/System/Posix/Process.hsc +++ b/System/Posix/Process.hsc @@ -78,10 +78,6 @@ import System.Posix.Process.Internals import System.Posix.Process.Common import System.Posix.Internals ( withFilePath ) -#ifdef __HUGS__ -{-# CFILES cbits/HsUnix.c #-} -#endif - -- | @'executeFile' cmd args env@ calls one of the -- @execv*@ family, depending on whether or not the current -- PATH is to be searched for the command, and whether or not an diff --git a/System/Posix/Process/ByteString.hsc b/System/Posix/Process/ByteString.hsc index ee2c9cf..64fc71e 100644 --- a/System/Posix/Process/ByteString.hsc +++ b/System/Posix/Process/ByteString.hsc @@ -90,10 +90,6 @@ import qualified Data.ByteString.Char8 as BC import System.Posix.ByteString.FilePath -#ifdef __HUGS__ -{-# CFILES cbits/HsUnix.c #-} -#endif - -- | @'executeFile' cmd args env@ calls one of the -- @execv*@ family, depending on whether or not the current -- PATH is to be searched for the command, and whether or not an diff --git a/System/Posix/Process/Common.hsc b/System/Posix/Process/Common.hsc index ee7310e..d0d2b09 100644 --- a/System/Posix/Process/Common.hsc +++ b/System/Posix/Process/Common.hsc @@ -88,10 +88,6 @@ import GHC.TopHandler ( runIO ) import GHC.IO ( unsafeUnmask, uninterruptibleMask_ ) #endif -#ifdef __HUGS__ -{-# CFILES cbits/HsUnix.c #-} -#endif - -- ----------------------------------------------------------------------------- -- Process environment diff --git a/System/Posix/Signals.hsc b/System/Posix/Signals.hsc index 9119190..e8fc1c5 100644 --- a/System/Posix/Signals.hsc +++ b/System/Posix/Signals.hsc @@ -602,16 +602,7 @@ awaitSignal maybe_sigset = do foreign import ccall unsafe "sigsuspend" c_sigsuspend :: Ptr CSigset -> IO CInt -#ifdef __HUGS__ -foreign import ccall unsafe "sigdelset" - c_sigdelset :: Ptr CSigset -> CInt -> IO CInt - -foreign import ccall unsafe "sigfillset" - c_sigfillset :: Ptr CSigset -> IO CInt - -foreign import ccall unsafe "sigismember" - c_sigismember :: Ptr CSigset -> CInt -> IO CInt -#elif defined(darwin_HOST_OS) && __GLASGOW_HASKELL__ < 706 +#if defined(darwin_HOST_OS) && __GLASGOW_HASKELL__ < 706 -- see http://ghc.haskell.org/trac/ghc/ticket/7359#comment:3 -- To be removed when support for GHC 7.4.x is dropped foreign import ccall unsafe "__hscore_sigdelset" @@ -631,7 +622,7 @@ foreign import capi unsafe "signal.h sigfillset" foreign import capi unsafe "signal.h sigismember" c_sigismember :: Ptr CSigset -> CInt -> IO CInt -#endif /* __HUGS__ */ +#endif foreign import ccall unsafe "sigpending" c_sigpending :: Ptr CSigset -> IO CInt diff --git a/System/Posix/Temp.hsc b/System/Posix/Temp.hsc index 349030b..2d7ca52 100644 --- a/System/Posix/Temp.hsc +++ b/System/Posix/Temp.hsc @@ -33,7 +33,7 @@ import System.Posix.IO import System.Posix.Types import System.Posix.Internals (withFilePath, peekFilePath) -#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__) +#if defined(__GLASGOW_HASKELL__) foreign import ccall unsafe "HsUnix.h __hscore_mkstemp" c_mkstemp :: CString -> IO CInt #endif @@ -48,7 +48,7 @@ foreign import ccall unsafe "HsUnix.h __hscore_mkstemp" mkstemp :: String -> IO (FilePath, Handle) mkstemp template' = do let template = template' ++ "XXXXXX" -#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__) +#if defined(__GLASGOW_HASKELL__) withFilePath template $ \ ptr -> do fd <- throwErrnoIfMinus1 "mkstemp" (c_mkstemp ptr) name <- peekFilePath ptr @@ -114,7 +114,7 @@ mkdtemp template' = do return name #endif -#if (!defined(__GLASGOW_HASKELL__) && !defined(__HUGS__)) || !HAVE_MKDTEMP +#if !defined(__GLASGOW_HASKELL__) || !HAVE_MKDTEMP foreign import ccall unsafe "mktemp" c_mktemp :: CString -> IO CString diff --git a/System/Posix/Temp/ByteString.hsc b/System/Posix/Temp/ByteString.hsc index 61bd7e9..84ad49e 100644 --- a/System/Posix/Temp/ByteString.hsc +++ b/System/Posix/Temp/ByteString.hsc @@ -38,7 +38,7 @@ import System.Posix.Directory (createDirectory) import System.Posix.IO import System.Posix.Types -#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__) +#if defined(__GLASGOW_HASKELL__) foreign import ccall unsafe "HsUnix.h __hscore_mkstemp" c_mkstemp :: CString -> IO CInt #endif @@ -53,7 +53,7 @@ foreign import ccall unsafe "HsUnix.h __hscore_mkstemp" mkstemp :: ByteString -> IO (RawFilePath, Handle) mkstemp template' = do let template = template' `B.append` (BC.pack "XXXXXX") -#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__) +#if defined(__GLASGOW_HASKELL__) withFilePath template $ \ ptr -> do fd <- throwErrnoIfMinus1 "mkstemp" (c_mkstemp ptr) name <- peekFilePath ptr @@ -114,7 +114,7 @@ mkdtemp template' = do return name #endif -#if (!defined(__GLASGOW_HASKELL__) && !defined(__HUGS__)) || !HAVE_MKDTEMP +#if !defined(__GLASGOW_HASKELL__) || !HAVE_MKDTEMP foreign import ccall unsafe "mktemp" c_mktemp :: CString -> IO CString -- cgit v1.2.3