mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-31 11:17:35 +02:00
Fix write_uintptr_fallback
This commit is contained in:
@ -464,7 +464,7 @@ template <typename T> constexpr auto num_bits() -> int {
|
|||||||
}
|
}
|
||||||
// std::numeric_limits<T>::digits may return 0 for 128-bit ints.
|
// std::numeric_limits<T>::digits may return 0 for 128-bit ints.
|
||||||
template <> constexpr auto num_bits<int128_opt>() -> int { return 128; }
|
template <> constexpr auto num_bits<int128_opt>() -> int { return 128; }
|
||||||
template <> constexpr auto num_bits<uint128_t>() -> int { return 128; }
|
template <> constexpr auto num_bits<uint128_fallback>() -> int { return 128; }
|
||||||
|
|
||||||
// A heterogeneous bit_cast used for converting 96-bit long double to uint128_t
|
// A heterogeneous bit_cast used for converting 96-bit long double to uint128_t
|
||||||
// and 128-bit pointers to uint128_fallback.
|
// and 128-bit pointers to uint128_fallback.
|
||||||
|
@ -1561,14 +1561,13 @@ TEST(format_test, format_pointer) {
|
|||||||
TEST(format_test, write_uintptr_fallback) {
|
TEST(format_test, write_uintptr_fallback) {
|
||||||
// Test that formatting a pointer by converting it to uint128_fallback works.
|
// Test that formatting a pointer by converting it to uint128_fallback works.
|
||||||
// This is needed to support systems without uintptr_t.
|
// This is needed to support systems without uintptr_t.
|
||||||
// TODO
|
auto s = std::string();
|
||||||
/*auto s = std::string();
|
|
||||||
fmt::detail::write_ptr<char>(
|
fmt::detail::write_ptr<char>(
|
||||||
std::back_inserter(s),
|
std::back_inserter(s),
|
||||||
fmt::detail::bit_cast<fmt::detail::uint128_fallback>(
|
fmt::detail::bit_cast<fmt::detail::uint128_fallback>(
|
||||||
reinterpret_cast<void*>(0xface)),
|
reinterpret_cast<void*>(0xface)),
|
||||||
nullptr);
|
nullptr);
|
||||||
EXPECT_EQ(s, "0xface");*/
|
EXPECT_EQ(s, "0xface");
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class color { red, green, blue };
|
enum class color { red, green, blue };
|
||||||
|
Reference in New Issue
Block a user