fmt 10.0.0-10.1.1 compile fixes

Implicit conversion operators and enums was removed for parity with std::format (fce74caa15).
This commit is contained in:
get
2023-06-11 21:51:49 -05:00
committed by Admiral H. Curtiss
parent 965283c263
commit 63467559b2
8 changed files with 38 additions and 8 deletions

View File

@ -6,6 +6,7 @@
#include <fmt/format.h>
#include <string>
#include <winerror.h>
#include <winrt/base.h>
#include "Common/CommonTypes.h"
@ -33,3 +34,14 @@ struct fmt::formatter<Common::HRWrap>
static_cast<u32>(hr.m_hr));
}
};
template <>
struct fmt::formatter<winrt::hresult>
{
constexpr auto parse(fmt::format_parse_context& ctx) { return ctx.begin(); }
template <typename FormatContext>
auto format(const winrt::hresult& hr, FormatContext& ctx) const
{
return fmt::format_to(ctx.out(), "{} ({:#010x})", Common::GetHResultMessage(hr), hr.value);
}
};