diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-25 12:32:09 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-25 12:32:09 +0000 |
commit | 5aba6dead5af747daf19e6f198180becfc59f0d2 (patch) | |
tree | cead0b83082fb9c127abbaa5bd82233588606759 /hash.c | |
parent | 94062178de18bbe379efea7a3ffe3a9bc5b37110 (diff) | |
download | ruby-5aba6dead5af747daf19e6f198180becfc59f0d2.tar.gz |
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
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -230,7 +230,7 @@ static const uint64_t prime2 = ((uint64_t)0xcdb32970 << 32) | 0x830fcaa1; static inline uint64_t mult_and_mix(uint64_t m1, uint64_t m2) { -#if defined(__GNUC__) && UINT_MAX != ULONG_MAX +#if defined HAVE_UINT128_T __uint128_t r = (__uint128_t) m1 * (__uint128_t) m2; return (uint64_t) (r >> 64) ^ (uint64_t) r; #else |