diff --git a/include/fmt/format.h b/include/fmt/format.h index 9b4f7357f550..34c9dc753bf5 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -369,8 +369,6 @@ class uint128_fallback { private: uint64_t lo_, hi_; - friend uint128_fallback umul128(uint64_t x, uint64_t y) noexcept; - public: constexpr uint128_fallback(uint64_t hi, uint64_t lo) : lo_(lo), hi_(hi) {} constexpr uint128_fallback(uint64_t value = 0) : lo_(value), hi_(0) {} @@ -1488,9 +1486,9 @@ inline uint128_fallback umul128(uint64_t x, uint64_t y) noexcept { auto p = static_cast(x) * static_cast(y); return {static_cast(p >> 64), static_cast(p)}; #elif defined(_MSC_VER) && defined(_M_X64) - auto result = uint128_fallback(); - result.lo_ = _umul128(x, y, &result.hi_); - return result; + auto hi = uint64_t{}; + auto lo = _umul128(x, y, &hi); + return {hi, lo}; #else const uint64_t mask = static_cast(max_value());