[commit: base] master: Remove some always-true CPP tests from System.IO.Error (662255a)

Ian Lynagh igloo at earth.li
Sun Feb 17 21:57:47 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/packages/base

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/662255a8834813077cfcf8f479e93ab5bbd60822

>---------------------------------------------------------------

commit 662255a8834813077cfcf8f479e93ab5bbd60822
Author: Ian Lynagh <ian at well-typed.com>
Date:   Sun Feb 17 18:42:55 2013 +0000

    Remove some always-true CPP tests from System.IO.Error
    
    If
        defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
    was False then compilation would have failed anyway, e.g. due to a
    missing definition for annotateIOError.

>---------------------------------------------------------------

 System/IO/Error.hs |    8 --------
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/System/IO/Error.hs b/System/IO/Error.hs
index a90e031..6fec277 100644
--- a/System/IO/Error.hs
+++ b/System/IO/Error.hs
@@ -112,7 +112,6 @@ tryIOError f   =  catch (do r <- f
                             return (Right r))
                         (return . Left)
 
-#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
 -- -----------------------------------------------------------------------------
 -- Constructing an IOError
 
@@ -131,7 +130,6 @@ mkIOError t location maybe_hdl maybe_filename =
                         ioe_handle = maybe_hdl, 
                         ioe_filename = maybe_filename
                         }
-#endif /* __GLASGOW_HASKELL__ || __HUGS__ */
 
 -- -----------------------------------------------------------------------------
 -- IOErrorType
@@ -273,7 +271,6 @@ isUserErrorType _ = False
 -- -----------------------------------------------------------------------------
 -- Miscellaneous
 
-#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
 ioeGetErrorType       :: IOError -> IOErrorType
 ioeGetErrorString     :: IOError -> String
 ioeGetLocation        :: IOError -> String
@@ -304,8 +301,6 @@ ioeSetLocation    ioe str      = ioe{ ioe_location = str }
 ioeSetHandle      ioe hdl      = ioe{ ioe_handle = Just hdl }
 ioeSetFileName    ioe filename = ioe{ ioe_filename = Just filename }
 
-#endif
-
 -- | Catch any 'IOError' that occurs in the computation and throw a
 -- modified version.
 modifyIOError :: (IOError -> IOError) -> IO a -> IO a
@@ -322,8 +317,6 @@ annotateIOError :: IOError
               -> Maybe Handle 
               -> Maybe FilePath 
               -> IOError 
-
-#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
 annotateIOError ioe loc hdl path = 
   ioe{ ioe_handle = hdl `mplus` ioe_handle ioe,
        ioe_location = loc, ioe_filename = path `mplus` ioe_filename ioe }
@@ -331,7 +324,6 @@ annotateIOError ioe loc hdl path =
     mplus :: Maybe a -> Maybe a -> Maybe a
     Nothing `mplus` ys = ys
     xs      `mplus` _  = xs
-#endif /* __GLASGOW_HASKELL__ || __HUGS__ */
 
 #ifndef __HUGS__
 -- | The 'catchIOError' function establishes a handler that receives any





More information about the ghc-commits mailing list