Wolfgang Jeltsch pushed to branch wip/jeltsch/base-buildable-with-ghc-9-14 at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • libraries/base/src/GHC/IO/Handle.hs
    1
    -{-# LANGUAGE Safe #-}
    
    1
    +{-# LANGUAGE CPP #-}
    
    2
    +{-# LANGUAGE Trustworthy #-}
    
    3
    +{-# LANGUAGE RecordWildCards #-}
    
    2 4
     
    
    3 5
     -- |
    
    4 6
     --
    
    ... ... @@ -75,3 +77,19 @@ module GHC.IO.Handle
    75 77
          ) where
    
    76 78
     
    
    77 79
     import GHC.Internal.IO.Handle
    
    80
    +
    
    81
    +#if __GLASGOW_HASKELL__ < 1000
    
    82
    +
    
    83
    +import GHC.Internal.Base (($), IO, return)
    
    84
    +import GHC.Internal.IO.Handle.Types (Handle__ (..))
    
    85
    +import GHC.Internal.IO.Handle.Internals (withHandle_)
    
    86
    +
    
    87
    +-- | Return the current 'NewlineMode' for the specified 'Handle'.
    
    88
    +--
    
    89
    +-- @since 4.23.0.0
    
    90
    +hGetNewlineMode :: Handle -> IO NewlineMode
    
    91
    +hGetNewlineMode hdl =
    
    92
    +  withHandle_ "hGetNewlineMode" hdl $ \Handle__{..} ->
    
    93
    +    return NewlineMode{ inputNL = haInputNL, outputNL = haOutputNL }
    
    94
    +
    
    95
    +#endif