projects/guix·blob javascript-team · refs

40 lines · 1.3 KiB

1https://github.com/vincenthz/hs-memory/commit/2738929ce15b4c8704bbbac24a08539b5d4bf30e.patch
2https://github.com/vincenthz/hs-memory/pull/99
3Adjusted so the '904' becomes '902'
4
5From 2738929ce15b4c8704bbbac24a08539b5d4bf30e Mon Sep 17 00:00:00 2001
6From: sternenseemann <[email protected]>
7Date: Mon, 14 Aug 2023 10:51:30 +0200
8Subject: [PATCH] Data.Memory.Internal.CompatPrim64: fix 32 bit with GHC >= 9.4
9
10Since 9.4, GHC.Prim exports Word64# operations like timesWord64# even on
11i686 whereas GHC.IntWord64 no longer exists. Therefore, we can just use
12the ready made solution.
13
14Closes #98, as it should be the better solution.
15---
16 Data/Memory/Internal/CompatPrim64.hs | 4 ++++
17 1 file changed, 4 insertions(+)
18
19diff --git a/Data/Memory/Internal/CompatPrim64.hs b/Data/Memory/Internal/CompatPrim64.hs
20index b9eef8a..a134c88 100644
21--- a/Data/Memory/Internal/CompatPrim64.hs
22+++ b/Data/Memory/Internal/CompatPrim64.hs
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 =