package/kodi: Fix building with fmt >= 10

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Bernd Kuhls 2023-07-30 19:12:30 +02:00 committed by Thomas Petazzoni
parent eb34442831
commit 88b188a242
4 changed files with 133 additions and 0 deletions

View File

@ -0,0 +1,31 @@
From cfbc0ec1b2cf2952fa4a279cf5fc71c15bf56f23 Mon Sep 17 00:00:00 2001
From: Lukas Rusak <lorusak@gmail.com>
Date: Tue, 27 Jun 2023 11:21:50 -0700
Subject: [PATCH] CGUIWindowHome: use AnnouncementFlagToString when logging
Upstream: https://github.com/xbmc/xbmc/commit/3a20f5b67ff32cc3663e0ccd72941e666e8756a4
Upstream: https://github.com/xbmc/xbmc/pull/23571
Signed-off-by: Lukas Rusak <lorusak@gmail.com>
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
xbmc/windows/GUIWindowHome.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/xbmc/windows/GUIWindowHome.cpp b/xbmc/windows/GUIWindowHome.cpp
index c42e073c48..abc6cfc94d 100644
--- a/xbmc/windows/GUIWindowHome.cpp
+++ b/xbmc/windows/GUIWindowHome.cpp
@@ -78,7 +78,8 @@ void CGUIWindowHome::Announce(ANNOUNCEMENT::AnnouncementFlag flag,
{
int ra_flag = 0;
- CLog::Log(LOGDEBUG, LOGANNOUNCE, "GOT ANNOUNCEMENT, type: {}, from {}, message {}", flag, sender, message);
+ CLog::Log(LOGDEBUG, LOGANNOUNCE, "GOT ANNOUNCEMENT, type: {}, from {}, message {}",
+ AnnouncementFlagToString(flag), sender, message);
// we are only interested in library changes
if ((flag & (ANNOUNCEMENT::VideoLibrary | ANNOUNCEMENT::AudioLibrary)) == 0)
--
2.39.2

View File

@ -0,0 +1,32 @@
From 8b1673044971cae84de7d34015230b9503f292f4 Mon Sep 17 00:00:00 2001
From: Lukas Rusak <lorusak@gmail.com>
Date: Tue, 27 Jun 2023 11:22:32 -0700
Subject: [PATCH] CGUIColorButtonControl: use explicit cast to
UTILS::COLOR::Color when formatting
Upstream: https://github.com/xbmc/xbmc/commit/c82006b575b78efbb3f5aff40a159b90f245ea9d
Upstream: https://github.com/xbmc/xbmc/pull/23571
Signed-off-by: Lukas Rusak <lorusak@gmail.com>
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
xbmc/guilib/GUIColorButtonControl.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/xbmc/guilib/GUIColorButtonControl.cpp b/xbmc/guilib/GUIColorButtonControl.cpp
index 940834cb68..67597d7ab5 100644
--- a/xbmc/guilib/GUIColorButtonControl.cpp
+++ b/xbmc/guilib/GUIColorButtonControl.cpp
@@ -188,7 +188,8 @@ void CGUIColorButtonControl::RenderInfoText()
void CGUIColorButtonControl::ProcessInfoText(unsigned int currentTime)
{
CRect labelRenderRect = m_labelInfo.GetRenderRect();
- bool changed = m_labelInfo.SetText(StringUtils::Format("#{:08X}", m_imgBoxColor));
+ bool changed = m_labelInfo.SetText(
+ StringUtils::Format("#{:08X}", static_cast<UTILS::COLOR::Color>(m_imgBoxColor)));
// Set Label X position based on image mask control position
float textWidth = m_labelInfo.GetTextWidth() + 2 * m_labelInfo.GetLabelInfo().offsetX;
float textPosX = m_imgColorMask->GetXPosition() - textWidth;
--
2.39.2

View File

@ -0,0 +1,33 @@
From ec1fd134e31b8c667ff06e02e21a75c4c3e87dfd Mon Sep 17 00:00:00 2001
From: Lukas Rusak <lorusak@gmail.com>
Date: Tue, 27 Jun 2023 11:24:02 -0700
Subject: [PATCH] CLog: allow using fmt::enums::format_as for explicit enum
conversion when using libfmt>=10
Upstream: https://github.com/xbmc/xbmc/commit/e4b1aa8450fabfb41379953c8ccec0a512421531
Upstream: https://github.com/xbmc/xbmc/pull/23571
Signed-off-by: Lukas Rusak <lorusak@gmail.com>
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
xbmc/utils/log.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/xbmc/utils/log.h b/xbmc/utils/log.h
index 9fc4aae368..adf46905a8 100644
--- a/xbmc/utils/log.h
+++ b/xbmc/utils/log.h
@@ -46,6 +46,10 @@ class dist_sink;
} // namespace sinks
} // namespace spdlog
+#if FMT_VERSION >= 100000
+using fmt::enums::format_as;
+#endif
+
class CLog : public ISettingsHandler, public ISettingCallback
{
public:
--
2.39.2

View File

@ -0,0 +1,37 @@
From 46f6d97f46254600bd34f77f335a475178d7aaa5 Mon Sep 17 00:00:00 2001
From: Lukas Rusak <lorusak@gmail.com>
Date: Tue, 27 Jun 2023 11:24:34 -0700
Subject: [PATCH] CLog: add formatter for std::atomic for explicit atomic
conversion when using libfmt>=10
Upstream: https://github.com/xbmc/xbmc/commit/26c164a28cfd18ceef7a1f2bbba5bf8a4a5a750c
Upstream: https://github.com/xbmc/xbmc/pull/23571
Signed-off-by: Lukas Rusak <lorusak@gmail.com>
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
xbmc/utils/log.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/xbmc/utils/log.h b/xbmc/utils/log.h
index adf46905a8..1c42c888cb 100644
--- a/xbmc/utils/log.h
+++ b/xbmc/utils/log.h
@@ -48,6 +48,14 @@ class dist_sink;
#if FMT_VERSION >= 100000
using fmt::enums::format_as;
+
+namespace fmt
+{
+template<typename T, typename Char>
+struct formatter<std::atomic<T>, Char> : formatter<T, Char>
+{
+};
+} // namespace fmt
#endif
class CLog : public ISettingsHandler, public ISettingCallback
--
2.39.2