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:
parent
965283c263
commit
63467559b2
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
|
|
||||||
|
#include "Common/EnumUtils.h"`
|
||||||
#include "Common/IniFile.h"
|
#include "Common/IniFile.h"
|
||||||
#include "jni/AndroidCommon/AndroidCommon.h"
|
#include "jni/AndroidCommon/AndroidCommon.h"
|
||||||
#include "jni/AndroidCommon/IDCache.h"
|
#include "jni/AndroidCommon/IDCache.h"
|
||||||
|
@ -69,7 +70,7 @@ Java_org_dolphinemu_dolphinemu_utils_GpuDriverHelper_00024Companion_getSystemDri
|
||||||
properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
|
properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
|
||||||
properties2.pNext = &driverProperties;
|
properties2.pNext = &driverProperties;
|
||||||
vkGetPhysicalDeviceProperties2(gpu_list.front(), &properties2);
|
vkGetPhysicalDeviceProperties2(gpu_list.front(), &properties2);
|
||||||
driverId = fmt::format("{}", driverProperties.driverID);
|
driverId = fmt::format("{}", Common::ToUnderlying(driverProperties.driverID));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
|
|
||||||
#include "HRWrap.h"
|
#include "HRWrap.h"
|
||||||
|
|
||||||
#include <winrt/base.h>
|
|
||||||
|
|
||||||
namespace Common
|
namespace Common
|
||||||
{
|
{
|
||||||
std::string GetHResultMessage(HRESULT hr)
|
std::string GetHResultMessage(HRESULT hr)
|
||||||
|
@ -12,4 +10,8 @@ std::string GetHResultMessage(HRESULT hr)
|
||||||
auto err = winrt::hresult_error(hr);
|
auto err = winrt::hresult_error(hr);
|
||||||
return winrt::to_string(err.message());
|
return winrt::to_string(err.message());
|
||||||
}
|
}
|
||||||
|
std::string GetHResultMessage(const winrt::hresult& hr)
|
||||||
|
{
|
||||||
|
return GetHResultMessage(hr.value);
|
||||||
|
}
|
||||||
} // namespace Common
|
} // namespace Common
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <winerror.h>
|
#include <winerror.h>
|
||||||
|
#include <winrt/base.h>
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
|
||||||
|
@ -33,3 +34,14 @@ struct fmt::formatter<Common::HRWrap>
|
||||||
static_cast<u32>(hr.m_hr));
|
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);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
#include <endian.h>
|
#include <endian.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <fmt/format.h>
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
|
||||||
namespace Common
|
namespace Common
|
||||||
|
@ -183,3 +185,15 @@ private:
|
||||||
value_type raw;
|
value_type raw;
|
||||||
};
|
};
|
||||||
} // Namespace Common
|
} // Namespace Common
|
||||||
|
|
||||||
|
template <typename value_type>
|
||||||
|
struct fmt::formatter<Common::BigEndianValue<value_type>>
|
||||||
|
{
|
||||||
|
fmt::formatter<value_type> m_formatter;
|
||||||
|
constexpr auto parse(format_parse_context& ctx) { return m_formatter.parse(ctx); }
|
||||||
|
template <typename FormatContext>
|
||||||
|
auto format(const Common::BigEndianValue<value_type>& value, FormatContext& ctx) const
|
||||||
|
{
|
||||||
|
return m_formatter.format(value.operator value_type(), ctx);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
|
|
||||||
|
#include "Common/HRWrap.h"
|
||||||
#include "Common/Logging/Log.h"
|
#include "Common/Logging/Log.h"
|
||||||
#include "Common/StringUtil.h"
|
#include "Common/StringUtil.h"
|
||||||
#include "InputCommon/ControllerInterface/ControllerInterface.h"
|
#include "InputCommon/ControllerInterface/ControllerInterface.h"
|
||||||
|
@ -506,7 +507,7 @@ private:
|
||||||
catch (winrt::hresult_error error)
|
catch (winrt::hresult_error error)
|
||||||
{
|
{
|
||||||
ERROR_LOG_FMT(CONTROLLERINTERFACE,
|
ERROR_LOG_FMT(CONTROLLERINTERFACE,
|
||||||
"WGInput: IRawGameController::GetCurrentReading failed: {:x}", error.code());
|
"WGInput: IRawGameController::GetCurrentReading failed: {}", error.code());
|
||||||
}
|
}
|
||||||
|
|
||||||
// IGamepad:
|
// IGamepad:
|
||||||
|
@ -518,7 +519,7 @@ private:
|
||||||
}
|
}
|
||||||
catch (winrt::hresult_error error)
|
catch (winrt::hresult_error error)
|
||||||
{
|
{
|
||||||
ERROR_LOG_FMT(CONTROLLERINTERFACE, "WGInput: IGamepad::GetCurrentReading failed: {:x}",
|
ERROR_LOG_FMT(CONTROLLERINTERFACE, "WGInput: IGamepad::GetCurrentReading failed: {}",
|
||||||
error.code());
|
error.code());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
#include "VideoCommon/Assets/DirectFilesystemAssetLibrary.h"
|
#include "VideoCommon/Assets/DirectFilesystemAssetLibrary.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <fmt/os.h>
|
|
||||||
|
#include <fmt/std.h>
|
||||||
|
|
||||||
#include "Common/FileUtil.h"
|
#include "Common/FileUtil.h"
|
||||||
#include "Common/Logging/Log.h"
|
#include "Common/Logging/Log.h"
|
||||||
|
|
|
@ -1863,7 +1863,7 @@ enum class ColorChannel : u32
|
||||||
template <>
|
template <>
|
||||||
struct fmt::formatter<ColorChannel> : EnumFormatter<ColorChannel::Alpha>
|
struct fmt::formatter<ColorChannel> : EnumFormatter<ColorChannel::Alpha>
|
||||||
{
|
{
|
||||||
formatter() : EnumFormatter({"Red", "Green", "Blue", "Alpha"}) {}
|
constexpr formatter() : EnumFormatter({"Red", "Green", "Blue", "Alpha"}) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class KonstSel : u32
|
enum class KonstSel : u32
|
||||||
|
|
|
@ -98,7 +98,6 @@ struct EFBCopyParams
|
||||||
template <>
|
template <>
|
||||||
struct fmt::formatter<EFBCopyParams>
|
struct fmt::formatter<EFBCopyParams>
|
||||||
{
|
{
|
||||||
std::shared_ptr<int> state;
|
|
||||||
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
|
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
|
||||||
template <typename FormatContext>
|
template <typename FormatContext>
|
||||||
auto format(const EFBCopyParams& uid, FormatContext& ctx) const
|
auto format(const EFBCopyParams& uid, FormatContext& ctx) const
|
||||||
|
|
Loading…
Reference in New Issue