gerbera: fix compilation with fmt 8.1
authorRosen Penev <redacted>
Sat, 29 Jan 2022 22:12:33 +0000 (14:12 -0800)
committerRosen Penev <redacted>
Sun, 30 Jan 2022 00:39:01 +0000 (16:39 -0800)
Signed-off-by: Rosen Penev <redacted>
multimedia/gerbera/patches/010-fmt.patch [new file with mode: 0644]

diff --git a/multimedia/gerbera/patches/010-fmt.patch b/multimedia/gerbera/patches/010-fmt.patch
new file mode 100644 (file)
index 0000000..72668a8
--- /dev/null
@@ -0,0 +1,39 @@
+From 82d84ac5e62c23e717198fc7b2ef190ff95e70d1 Mon Sep 17 00:00:00 2001
+From: kyak <bas@bmail.ru>
+Date: Wed, 12 Jan 2022 19:41:37 +0300
+Subject: [PATCH] Fix for fmt > 8.0
+
+---
+ src/util/logger.h | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+--- a/src/util/logger.h
++++ b/src/util/logger.h
+@@ -32,7 +32,9 @@
+ #ifndef __LOGGER_H__
+ #define __LOGGER_H__
++#include <fmt/format.h>
+ #include <spdlog/spdlog.h>
++#include <type_traits>
+ #define log_debug SPDLOG_DEBUG
+ #define log_info SPDLOG_INFO
+@@ -40,4 +42,17 @@
+ #define log_error SPDLOG_ERROR
+ #define log_js SPDLOG_INFO
++#if FMT_VERSION >= 80100
++template <typename T>
++struct fmt::formatter<T, std::enable_if_t<std::is_enum_v<T>, char>>
++    : formatter<std::underlying_type_t<T>> {
++    template <typename FormatContext>
++    auto format(const T& value, FormatContext& ctx) -> decltype(ctx.out())
++    {
++        return fmt::formatter<std::underlying_type_t<T>>::format(
++            static_cast<std::underlying_type_t<T>>(value), ctx);
++    }
++};
++#endif
++
+ #endif // __LOGGER_H__
git clone https://git.99rst.org/PROJECT