summaryrefslogtreecommitdiff
path: root/src/common/logging
diff options
context:
space:
mode:
authorGravatar liushuyu2022-01-08 16:02:49 -0700
committerGravatar liushuyu2022-01-08 16:02:49 -0700
commit099dd0c0d299d0f3541221928814e9001a69623a (patch)
tree3d417727647556113693c1a0b649e38d21583023 /src/common/logging
parentlogging: adapt to changes in fmt 8.1 (diff)
downloadyuzu-099dd0c0d299d0f3541221928814e9001a69623a.tar.gz
yuzu-099dd0c0d299d0f3541221928814e9001a69623a.tar.xz
yuzu-099dd0c0d299d0f3541221928814e9001a69623a.zip
logging/log: use `underlying_type` instead of hardcoding types
Diffstat (limited to 'src/common/logging')
-rw-r--r--src/common/logging/log.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index b6a14972f..096a441b8 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -16,10 +16,12 @@
16// a generic formatter for enum classes (<= 32 bits) 16// a generic formatter for enum classes (<= 32 bits)
17#if FMT_VERSION >= 80100 17#if FMT_VERSION >= 80100
18template <typename T> 18template <typename T>
19struct fmt::formatter<T, std::enable_if_t<std::is_enum_v<T>, char>> : formatter<u32> { 19struct fmt::formatter<T, std::enable_if_t<std::is_enum_v<T>, char>>
20 : formatter<std::underlying_type_t<T>> {
20 template <typename FormatContext> 21 template <typename FormatContext>
21 auto format(const T& value, FormatContext& ctx) -> decltype(ctx.out()) { 22 auto format(const T& value, FormatContext& ctx) -> decltype(ctx.out()) {
22 return fmt::formatter<u32>::format(static_cast<u32>(value), ctx); 23 return fmt::formatter<std::underlying_type_t<T>>::format(
24 static_cast<std::underlying_type_t<T>>(value), ctx);
23 } 25 }
24}; 26};
25#endif 27#endif