Skip to content

Commit

Permalink
Fix handling of 96-bit long double with -m32
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Feb 17, 2022
1 parent d8e1dd4 commit 532a69a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions include/fmt/format-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,11 @@ struct fp {
template <typename Float> explicit FMT_CONSTEXPR fp(Float n) { assign(n); }

template <typename Float>
using is_supported = bool_constant<sizeof(Float) == sizeof(uint32_t) ||
sizeof(Float) == 2 * sizeof(uint32_t) ||
std::numeric_limits<Float>::digits == 64>;
using is_supported =
bool_constant<sizeof(Float) == sizeof(uint32_t) ||
sizeof(Float) == sizeof(uint64_t) ||
(sizeof(Float) == sizeof(uint128_t) &&
std::numeric_limits<Float>::digits == 64)>;

// Assigns d to this and return true iff predecessor is closer than successor.
template <typename Float, FMT_ENABLE_IF(is_supported<Float>::value)>
Expand Down

0 comments on commit 532a69a

Please sign in to comment.