Don't assume 8-bytes integers == "long long".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shyouhei 2018-01-02 06:41:44 +00:00
Родитель f6f1cfcbe7
Коммит ef19834ed9
1 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -293,10 +293,15 @@ nlz_int128(uint128_t x)
static inline unsigned int static inline unsigned int
nlz_intptr(uintptr_t x) nlz_intptr(uintptr_t x)
{ {
#if SIZEOF_VOIDP == 8 #if SIZEOF_UINTPTR_T == SIZEOF_INT
return nlz_long_long(x);
#elif SIZEOF_VOIDP == 4
return nlz_int(x); return nlz_int(x);
#elif SIZEOF_UINTPTR_T == SIZEOF_LONG
return nlz_long(x);
#elif SIZEOF_UINTPTR_T == SIZEOF_LONG_LONG
return nlz_long_long(x);
#else
#error no known integer type corresponds uintptr_t
return /* sane compiler */ ~0;
#endif #endif
} }