1From 22b3a91473d548456a0823f9f170db0d7db5a444 Mon Sep 17 00:00:00 2001 2From: kyak <bas@bmail.ru> 3Date: Wed, 12 Jan 2022 19:41:37 +0300 4Subject: [PATCH] Fix for fmt > 8.0 5 6Upstream-Status: Backport [https://github.com/gerbera/gerbera/commit/82d84ac5e62c23e717198fc7b2ef190ff95e70d1] 7Signed-off-by: Khem Raj <raj.khem@gmail.com> 8--- 9 src/util/logger.h | 15 +++++++++++++++ 10 1 file changed, 15 insertions(+) 11 12diff --git a/src/util/logger.h b/src/util/logger.h 13index 8a8f0b1f..0a512bff 100644 14--- a/src/util/logger.h 15+++ b/src/util/logger.h 16@@ -32,7 +32,9 @@ 17 #ifndef __LOGGER_H__ 18 #define __LOGGER_H__ 19 20+#include <fmt/format.h> 21 #include <spdlog/spdlog.h> 22+#include <type_traits> 23 24 #define log_debug SPDLOG_DEBUG 25 #define log_info SPDLOG_INFO 26@@ -40,4 +42,17 @@ 27 #define log_error SPDLOG_ERROR 28 #define log_js SPDLOG_INFO 29 30+#if FMT_VERSION >= 80100 31+template <typename T> 32+struct fmt::formatter<T, std::enable_if_t<std::is_enum_v<T>, char>> 33+ : formatter<std::underlying_type_t<T>> { 34+ template <typename FormatContext> 35+ auto format(const T& value, FormatContext& ctx) -> decltype(ctx.out()) 36+ { 37+ return fmt::formatter<std::underlying_type_t<T>>::format( 38+ static_cast<std::underlying_type_t<T>>(value), ctx); 39+ } 40+}; 41+#endif 42+ 43 #endif // __LOGGER_H__ 44-- 452.35.0 46 47