Skip to content

Commit

Permalink
support ghc 9.4
Browse files Browse the repository at this point in the history
  • Loading branch information
krangelov committed Jan 17, 2024
1 parent 88e3b2a commit 413e92e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/compiler/Data/Binary/Get.hs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ import Data.STRef
import GHC.Base
import GHC.Word
--import GHC.Int
#if MIN_VERSION_base(4,16,0)
import GHC.Exts (wordToWord16#, word16ToWord#, wordToWord32#, word32ToWord#)
#endif
#if __GLASGOW_HASKELL__ >= 900
import GHC.Word (uncheckedShiftL64#)
#endif
#endif

-- Control.Monad.Fail import will become redundant in GHC 8.8+
Expand Down Expand Up @@ -532,8 +538,13 @@ shiftl_w32 :: Word32 -> Int -> Word32
shiftl_w64 :: Word64 -> Int -> Word64

#if defined(__GLASGOW_HASKELL__) && !defined(__HADDOCK__)
#if MIN_VERSION_base(4,16,0)
shiftl_w16 (W16# w) (I# i) = W16# (wordToWord16# ((word16ToWord# w) `uncheckedShiftL#` i))
shiftl_w32 (W32# w) (I# i) = W32# (wordToWord32# ((word32ToWord# w) `uncheckedShiftL#` i))
#else
shiftl_w16 (W16# w) (I# i) = W16# (w `uncheckedShiftL#` i)
shiftl_w32 (W32# w) (I# i) = W32# (w `uncheckedShiftL#` i)
#endif

#if WORD_SIZE_IN_BITS < 64
shiftl_w64 (W64# w) (I# i) = W64# (w `uncheckedShiftL64#` i)
Expand All @@ -545,7 +556,12 @@ foreign import ccall unsafe "stg_uncheckedShiftL64"
#endif

#else
#if __GLASGOW_HASKELL__ <= 810
shiftl_w64 (W64# w) (I# i) = W64# (w `uncheckedShiftL#` i)
#else
shiftl_w64 (W64# w) (I# i) = W64# (w `uncheckedShiftL64#` i)
#endif

#endif

#else
Expand Down

0 comments on commit 413e92e

Please sign in to comment.