Add a missing check that __uint128_t exists before using it.

I noticed a compilation error when building a 64-bit binary with this library while using xlclang on AIX, and this change seems to fix it.
This commit is contained in:
Matthew Wozniczka 2024-03-16 12:18:20 -07:00 committed by GitHub
parent bafd9d9c5f
commit 9ab4ac837b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -331,7 +331,7 @@ value128 full_multiplication(uint64_t a, uint64_t b) {
answer.low = a * b; answer.low = a * b;
#elif defined(FASTFLOAT_32BIT) || (defined(_WIN64) && !defined(__clang__)) #elif defined(FASTFLOAT_32BIT) || (defined(_WIN64) && !defined(__clang__))
answer.low = _umul128(a, b, &answer.high); // _umul128 not available on ARM64 answer.low = _umul128(a, b, &answer.high); // _umul128 not available on ARM64
#elif defined(FASTFLOAT_64BIT) #elif defined(FASTFLOAT_64BIT) && defined(__SIZEOF_INT128__)
__uint128_t r = ((__uint128_t)a) * b; __uint128_t r = ((__uint128_t)a) * b;
answer.low = uint64_t(r); answer.low = uint64_t(r);
answer.high = uint64_t(r >> 64); answer.high = uint64_t(r >> 64);