| 1 | https://github.com/vincenthz/hs-memory/commit/2738929ce15b4c8704bbbac24a08539b5d4bf30e.patch
|
| 2 | https://github.com/vincenthz/hs-memory/pull/99
|
| 3 | Adjusted so the '904' becomes '902'
|
| 4 |
|
| 5 | From 2738929ce15b4c8704bbbac24a08539b5d4bf30e Mon Sep 17 00:00:00 2001
|
| 6 | From: sternenseemann <[email protected]>
|
| 7 | Date: Mon, 14 Aug 2023 10:51:30 +0200
|
| 8 | Subject: [PATCH] Data.Memory.Internal.CompatPrim64: fix 32 bit with GHC >= 9.4
|
| 9 |
|
| 10 | Since 9.4, GHC.Prim exports Word64# operations like timesWord64# even on
|
| 11 | i686 whereas GHC.IntWord64 no longer exists. Therefore, we can just use
|
| 12 | the ready made solution.
|
| 13 |
|
| 14 | Closes #98, as it should be the better solution.
|
| 15 | ---
|
| 16 | Data/Memory/Internal/CompatPrim64.hs | 4 ++++
|
| 17 | 1 file changed, 4 insertions(+)
|
| 18 |
|
| 19 | diff --git a/Data/Memory/Internal/CompatPrim64.hs b/Data/Memory/Internal/CompatPrim64.hs
|
| 20 | index b9eef8a..a134c88 100644
|
| 21 | |
| 22 | |
| 23 | @@ -150,6 +150,7 @@ w64# :: Word# -> Word# -> Word# -> Word64#
|
| 24 | w64# w _ _ = w
|
| 25 |
|
| 26 | #elif WORD_SIZE_IN_BITS == 32
|
| 27 | +#if __GLASGOW_HASKELL__ < 902
|
| 28 | import GHC.IntWord64
|
| 29 | import GHC.Prim (Word#)
|
| 30 |
|
| 31 | @@ -158,6 +159,9 @@ timesWord64# a b =
|
| 32 | let !ai = word64ToInt64# a
|
| 33 | !bi = word64ToInt64# b
|
| 34 | in int64ToWord64# (timesInt64# ai bi)
|
| 35 | +#else
|
| 36 | +import GHC.Prim
|
| 37 | +#endif
|
| 38 |
|
| 39 | w64# :: Word# -> Word# -> Word# -> Word64#
|
| 40 | w64# _ hw lw =
|