[Git][ghc/ghc][wip/jeltsch/base-buildable-with-ghc-9-14] Add `hGetNewlineMode` for GHC 9.14
Wolfgang Jeltsch pushed to branch wip/jeltsch/base-buildable-with-ghc-9-14 at Glasgow Haskell Compiler / GHC Commits: 6475c878 by Wolfgang Jeltsch at 2026-05-19T14:28:06+03:00 Add `hGetNewlineMode` for GHC 9.14 - - - - - 1 changed file: - libraries/base/src/GHC/IO/Handle.hs Changes: ===================================== libraries/base/src/GHC/IO/Handle.hs ===================================== @@ -1,4 +1,6 @@ -{-# LANGUAGE Safe #-} +{-# LANGUAGE CPP #-} +{-# LANGUAGE Trustworthy #-} +{-# LANGUAGE RecordWildCards #-} -- | -- @@ -75,3 +77,19 @@ module GHC.IO.Handle ) where import GHC.Internal.IO.Handle + +#if __GLASGOW_HASKELL__ < 1000 + +import GHC.Internal.Base (($), IO, return) +import GHC.Internal.IO.Handle.Types (Handle__ (..)) +import GHC.Internal.IO.Handle.Internals (withHandle_) + +-- | Return the current 'NewlineMode' for the specified 'Handle'. +-- +-- @since 4.23.0.0 +hGetNewlineMode :: Handle -> IO NewlineMode +hGetNewlineMode hdl = + withHandle_ "hGetNewlineMode" hdl $ \Handle__{..} -> + return NewlineMode{ inputNL = haInputNL, outputNL = haOutputNL } + +#endif View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6475c878d64eceea90293a5acca6600f... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6475c878d64eceea90293a5acca6600f... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Wolfgang Jeltsch (@jeltsch)