Skip to content

Commit 7e33a66

Browse files
committed
Fix #185 Don't depend on GHC.IO.* from base, from GHC 9.10
1 parent 5931168 commit 7e33a66

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

ansi-terminal/ansi-terminal.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ Library
4141
Build-Depends: base >= 4.8.0.0 && < 5
4242
, ansi-terminal-types == 1.1.3
4343
, colour >= 2.1.0
44+
if impl(ghc >= 9.10)
45+
Build-Depends: ghc-internal >= 9.1001.0
4446
if os(windows)
4547
Hs-Source-Dirs: win
4648
Other-Modules: System.Console.ANSI.Windows.Foreign

ansi-terminal/stack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
snapshot: lts-24.0 # GHC 9.10.2
1+
snapshot: lts-24.10 # GHC 9.10.2
22
flags:
33
ansi-terminal:
44
example: false

ansi-terminal/win/System/Console/ANSI/Windows/Win32/Types.hs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,29 @@ import Foreign.C.String ( peekCWString )
4141
import Foreign.C.Types ( CChar, CInt (..), CShort (..), CWchar )
4242
import Foreign.Ptr ( Ptr, nullPtr )
4343
import Foreign.StablePtr ( StablePtr, freeStablePtr, newStablePtr )
44+
#if MIN_VERSION_base(4,20,0)
45+
import GHC.Internal.IO.Handle.Types ( Handle (..), Handle__ (..) )
46+
import GHC.Internal.IO.FD ( FD(..) ) -- A wrapper around an Int32
47+
#else
4448
import GHC.IO.Handle.Types ( Handle (..), Handle__ (..) )
4549
import GHC.IO.FD ( FD(..) ) -- A wrapper around an Int32
50+
#endif
4651
import Numeric ( showHex )
4752
import System.IO.Error ( ioeSetErrorString )
4853

4954
#if defined(__IO_MANAGER_WINIO__)
55+
#if MIN_VERSION_base(4,20,0)
56+
import GHC.Internal.IO.Exception
57+
( IOErrorType (InappropriateType), IOException (IOError), ioException )
58+
import GHC.Internal.IO.SubSystem ( (<!>) )
59+
import GHC.Internal.IO.Windows.Handle ( ConsoleHandle, Io, NativeHandle, toHANDLE )
60+
#else
5061
import GHC.IO.Exception
5162
( IOErrorType (InappropriateType), IOException (IOError), ioException )
5263
import GHC.IO.SubSystem ( (<!>) )
5364
import GHC.IO.Windows.Handle ( ConsoleHandle, Io, NativeHandle, toHANDLE )
5465
#endif
66+
#endif
5567

5668
type Addr = Ptr ()
5769
type BOOL = Bool

0 commit comments

Comments
 (0)