summaryrefslogtreecommitdiff
path: root/libraries/base/System/Posix
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2013-09-15 23:05:05 +0200
committerHerbert Valerio Riedel <hvr@gnu.org>2013-09-17 09:54:07 +0200
commit0f5eae0232a86ec57d841a83e6929361e2751270 (patch)
tree7cc7b87fce8238cd9ff6b65fb0c37f515191aa6e /libraries/base/System/Posix
parent43ece172e7045d5ba633be6193f3e908eaa81f00 (diff)
downloadhaskell-0f5eae0232a86ec57d841a83e6929361e2751270.tar.gz
Constant-fold `__GLASGOW_HASKELL__` CPP conditionals
Now that HUGS and NHC specific code has been removed, this commit "folds" the now redundant `#if((n)def)`s containing `__GLASGOW_HASKELL__`. This renders `base` officially GHC only. This commit also removes redundant `{-# LANGUAGE CPP #-}`. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Diffstat (limited to 'libraries/base/System/Posix')
-rw-r--r--libraries/base/System/Posix/Internals.hs15
-rw-r--r--libraries/base/System/Posix/Types.hs6
2 files changed, 0 insertions, 21 deletions
diff --git a/libraries/base/System/Posix/Internals.hs b/libraries/base/System/Posix/Internals.hs
index 156ab28e80..833366e042 100644
--- a/libraries/base/System/Posix/Internals.hs
+++ b/libraries/base/System/Posix/Internals.hs
@@ -41,7 +41,6 @@ import Data.Maybe
import System.IO.Error
#endif
-#if __GLASGOW_HASKELL__
import GHC.Base
import GHC.Num
import GHC.Real
@@ -53,7 +52,6 @@ import GHC.IO.Device
import {-# SOURCE #-} GHC.IO.Encoding (getFileSystemEncoding)
import qualified GHC.Foreign as GHC
#endif
-#endif
-- ---------------------------------------------------------------------------
-- Debugging the base package
@@ -137,9 +135,7 @@ statGetType p_stat = do
ioe_unknownfiletype :: IOException
ioe_unknownfiletype = IOError Nothing UnsupportedOperation "fdType"
"unknown file type"
-#if __GLASGOW_HASKELL__
Nothing
-#endif
Nothing
fdGetMode :: FD -> IO IOMode
@@ -182,17 +178,10 @@ newFilePath :: FilePath -> IO CString
peekFilePath :: CString -> IO FilePath
peekFilePathLen :: CStringLen -> IO FilePath
-#if __GLASGOW_HASKELL__
withFilePath fp f = getFileSystemEncoding >>= \enc -> GHC.withCString enc fp f
newFilePath fp = getFileSystemEncoding >>= \enc -> GHC.newCString enc fp
peekFilePath fp = getFileSystemEncoding >>= \enc -> GHC.peekCString enc fp
peekFilePathLen fp = getFileSystemEncoding >>= \enc -> GHC.peekCStringLen enc fp
-#else
-withFilePath = withCString
-newFilePath = newCString
-peekFilePath = peekCString
-peekFilePathLen = peekCStringLen
-#endif
#endif
@@ -240,7 +229,6 @@ tcSetAttr fd fun = do
throwErrnoIfMinus1Retry_ "tcSetAttr"
(c_tcgetattr fd p_tios)
-#ifdef __GLASGOW_HASKELL__
-- Save a copy of termios, if this is a standard file descriptor.
-- These terminal settings are restored in hs_exit().
when (fd <= 2) $ do
@@ -249,7 +237,6 @@ tcSetAttr fd fun = do
saved_tios <- mallocBytes sizeof_termios
copyBytes saved_tios p_tios sizeof_termios
set_saved_termios fd saved_tios
-#endif
-- tcsetattr() when invoked by a background process causes the process
-- to be sent SIGTTOU regardless of whether the process has TOSTOP set
@@ -271,13 +258,11 @@ tcSetAttr fd fun = do
c_sigprocmask const_sig_setmask p_old_sigset nullPtr
return r
-#ifdef __GLASGOW_HASKELL__
foreign import ccall unsafe "HsBase.h __hscore_get_saved_termios"
get_saved_termios :: CInt -> IO (Ptr CTermios)
foreign import ccall unsafe "HsBase.h __hscore_set_saved_termios"
set_saved_termios :: CInt -> (Ptr CTermios) -> IO ()
-#endif
#else
diff --git a/libraries/base/System/Posix/Types.hs b/libraries/base/System/Posix/Types.hs
index 82760c51fd..dd5b98771b 100644
--- a/libraries/base/System/Posix/Types.hs
+++ b/libraries/base/System/Posix/Types.hs
@@ -4,9 +4,7 @@
, MagicHash
, GeneralizedNewtypeDeriving
#-}
-#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}
-#endif
-----------------------------------------------------------------------------
-- |
@@ -97,7 +95,6 @@ import Foreign.C
import Data.Typeable
-- import Data.Bits
-#ifdef __GLASGOW_HASKELL__
import GHC.Base
import GHC.Enum
import GHC.Num
@@ -105,9 +102,6 @@ import GHC.Real
-- import GHC.Prim
import GHC.Read
import GHC.Show
-#else
-import Control.Monad
-#endif
#include "CTypes.h"