Skip to content

Commit 8880af9

Browse files
committed
Use UINT128_T support flag from configure
Current check for __uint128_t in hash.c is not valid, since it ignores compilers other than gcc. We hit this on lcc on e2k platform. Configure script properly checks from 128-bit data types support and sets HAVE_UINT128_T accordingly. This approach is already used within ruby at bignum.c, random.c, etc. Probably hash.c is an overlooked remnant of old days. This patch fixes this. [ruby-core:84438] [Bug #14231] [Fix GH-1781] From: Andrew Savchenko <bircoph@altlinux.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 135f24c commit 8880af9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ static const uint64_t prime2 = ((uint64_t)0xcdb32970 << 32) | 0x830fcaa1;
230230
static inline uint64_t
231231
mult_and_mix(uint64_t m1, uint64_t m2)
232232
{
233-
#if defined(__GNUC__) && UINT_MAX != ULONG_MAX
233+
#if defined HAVE_UINT128_T
234234
__uint128_t r = (__uint128_t) m1 * (__uint128_t) m2;
235235
return (uint64_t) (r >> 64) ^ (uint64_t) r;
236236
#else

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy