diff --git a/third_party/fmt/include/fmt/core.h b/third_party/fmt/include/fmt/core.h index f993843925d5..6f8038bfcbd1 100644 --- a/third_party/fmt/include/fmt/core.h +++ b/third_party/fmt/include/fmt/core.h @@ -234,7 +234,13 @@ using std_string_view = std::experimental::basic_string_view; template struct std_string_view {}; #endif - +#if defined(__SIZEOF_INT128__) +# define FMT_USE_INT128 1 +using fmt_uint128_builtin_t = __uint128_t; +#else +# define FMT_USE_INT128 0 +using fmt_uint128_builtin_t = {}; +#endif using fmt_int128_t = duckdb::hugeint_t; using fmt_uint128_t = duckdb::uhugeint_t; diff --git a/third_party/fmt/include/fmt/format-inl.h b/third_party/fmt/include/fmt/format-inl.h index d04094903512..9f093fe50b26 100644 --- a/third_party/fmt/include/fmt/format-inl.h +++ b/third_party/fmt/include/fmt/format-inl.h @@ -390,7 +390,7 @@ inline bool operator==(fp x, fp y) { return x.f == y.f && x.e == y.e; } // Computes lhs * rhs / pow(2, 64) rounded to nearest with half-up tie breaking. inline uint64_t multiply(uint64_t lhs, uint64_t rhs) { #if FMT_USE_INT128 - auto product = static_cast(lhs) * rhs; + auto product = static_cast(lhs) * rhs; auto f = static_cast(product >> 64); return (static_cast(product) & (1ULL << 63)) != 0 ? f + 1 : f; #else @@ -427,7 +427,7 @@ FMT_FUNC fp get_cached_power(int min_exponent, int& pow10_exponent) { return {data::pow10_significands[index], data::pow10_exponents[index]}; } -// A simple accumulator to hold the sums of terms in bigint::square if fmt_uint128_t +// A simple accumulator to hold the sums of terms in bigint::square if fmt_uint128_builtin_t // is not available. struct accumulator { uint64_t lower; @@ -629,7 +629,7 @@ class bigint { int num_bigits = static_cast(bigits_.size()); int num_result_bigits = 2 * num_bigits; bigits_.resize(num_result_bigits); - using accumulator_t = conditional_t; + using accumulator_t = conditional_t; auto sum = accumulator_t(); for (int bigit_index = 0; bigit_index < num_bigits; ++bigit_index) { // Compute bigit at position bigit_index of the result by adding