Skip to content

Commit

Permalink
Fix building with -fportable
Browse files Browse the repository at this point in the history
Tested locally with GHC versions 8.10, 9.6, 9.8, 9.10 and 9.12.

Closes: #88
  • Loading branch information
erikd committed Nov 26, 2024
1 parent 888e7cc commit 59fb2bc
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Data/HashTable/Internal/CacheLine.hs
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,11 @@ firstBitSet# i# = word2Int# ((or# zeroCase# posw#))
27#
!idx = I# (word2Int# idxW#)
!(I8# pos8#) = U.unsafeIndex deBruijnBitPositions idx
#if __GLASGOW_HASKELL__ >= 900
!posw# = int2Word# (int8ToInt# pos8#)
#else
!posw# = int2Word# pos8#

#endif
#endif


Expand Down Expand Up @@ -745,7 +748,7 @@ cacheLineSearch :: IntArray s -- ^ vector to search
-- \"-1\" if not found
cacheLineSearch !vec !start !value = do
#ifdef NO_C_SEARCH
let !vlen = M.length vec
vlen <- M.length vec
let !st1 = vlen - start
let !nvlen = numElemsInCacheLine - st1
let adv = (start + cacheLineIntMask) .&. complement cacheLineIntMask
Expand Down Expand Up @@ -776,7 +779,7 @@ cacheLineSearch2 :: IntArray s -- ^ vector to search
-- \"-1\" if not found
cacheLineSearch2 !vec !start !value !value2 = do
#ifdef NO_C_SEARCH
let !vlen = M.length vec
!vlen <- M.length vec
let !st1 = vlen - start
let !nvlen = numElemsInCacheLine - st1
let adv = (start + cacheLineIntMask) .&. complement cacheLineIntMask
Expand Down Expand Up @@ -807,7 +810,7 @@ cacheLineSearch3 :: IntArray s -- ^ vector to search
-- \"-1\" if not found
cacheLineSearch3 !vec !start !value !value2 !value3 = do
#ifdef NO_C_SEARCH
let !vlen = M.length vec
!vlen <- M.length vec
let !st1 = vlen - start
let !nvlen = numElemsInCacheLine - st1
let adv = (start + cacheLineIntMask) .&. complement cacheLineIntMask
Expand Down

0 comments on commit 59fb2bc

Please sign in to comment.