From 67ccf0900432227de3f7f9f99e3c8f0d29797b4005ba87e99a71ffafd97b7d89 Mon Sep 17 00:00:00 2001 From: Luigi Baldoni Date: Tue, 14 Apr 2020 17:10:31 +0000 Subject: [PATCH 1/2] Accepting request 793884 from home:frispete:Tumbleweed - Apply 7d01859ef16e6b65bc023ad8bebfedecb088bf81.patch to fix kodi compilation and probably others: https://github.com/fmtlib/fmt/issues/1620 OBS-URL: https://build.opensuse.org/request/show/793884 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/fmt?expand=0&rev=19 --- ...859ef16e6b65bc023ad8bebfedecb088bf81.patch | 46 +++++++++++++++++++ fmt.changes | 7 +++ fmt.spec | 2 + 3 files changed, 55 insertions(+) create mode 100644 7d01859ef16e6b65bc023ad8bebfedecb088bf81.patch diff --git a/7d01859ef16e6b65bc023ad8bebfedecb088bf81.patch b/7d01859ef16e6b65bc023ad8bebfedecb088bf81.patch new file mode 100644 index 0000000..8d13cd2 --- /dev/null +++ b/7d01859ef16e6b65bc023ad8bebfedecb088bf81.patch @@ -0,0 +1,46 @@ +From 7d01859ef16e6b65bc023ad8bebfedecb088bf81 Mon Sep 17 00:00:00 2001 +From: Victor Zverovich +Date: Wed, 8 Apr 2020 12:32:34 -0700 +Subject: [PATCH] Fix handling of unsigned char strings in printf + +--- + include/fmt/core.h | 8 ++++++++ + test/printf-test.cc | 6 ++++++ + 2 files changed, 14 insertions(+) + +diff --git a/include/fmt/core.h b/include/fmt/core.h +index 6df2875ac..dc10722bf 100644 +--- a/include/fmt/core.h ++++ b/include/fmt/core.h +@@ -972,6 +972,14 @@ template struct arg_mapper { + static_assert(std::is_same::value, "invalid string type"); + return reinterpret_cast(val); + } ++ FMT_CONSTEXPR const char* map(signed char* val) { ++ const auto* const_val = val; ++ return map(const_val); ++ } ++ FMT_CONSTEXPR const char* map(unsigned char* val) { ++ const auto* const_val = val; ++ return map(const_val); ++ } + + FMT_CONSTEXPR const void* map(void* val) { return val; } + FMT_CONSTEXPR const void* map(const void* val) { return val; } +diff --git a/test/printf-test.cc b/test/printf-test.cc +index 5aaa27b13..545e02aab 100644 +--- a/test/printf-test.cc ++++ b/test/printf-test.cc +@@ -447,6 +447,12 @@ TEST(PrintfTest, String) { + EXPECT_PRINTF(L" (null)", L"%10s", null_wstr); + } + ++TEST(PrintfTest, UCharString) { ++ unsigned char str[] = "test"; ++ unsigned char* pstr = str; ++ EXPECT_EQ("test", fmt::sprintf("%s", pstr)); ++} ++ + TEST(PrintfTest, Pointer) { + int n; + void* p = &n; diff --git a/fmt.changes b/fmt.changes index 14162a5..7f691a3 100644 --- a/fmt.changes +++ b/fmt.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Apr 14 13:04:56 UTC 2020 - Hans-Peter Jansen + +- Apply 7d01859ef16e6b65bc023ad8bebfedecb088bf81.patch + to fix kodi compilation and probably others: + https://github.com/fmtlib/fmt/issues/1620 + ------------------------------------------------------------------- Mon Apr 6 14:21:08 UTC 2020 - Luigi Baldoni diff --git a/fmt.spec b/fmt.spec index e668db0..720e443 100644 --- a/fmt.spec +++ b/fmt.spec @@ -22,9 +22,11 @@ Version: 6.2.0 Release: 0 Summary: A formatting library for C++ License: MIT +Group: System/Libraries URL: http://fmtlib.net/ Source0: https://github.com/fmtlib/fmt/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: baselibs.conf +Patch0: 7d01859ef16e6b65bc023ad8bebfedecb088bf81.patch BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: pkgconfig From fd7557086dad6a78f2fe2ae36dc439a26419b35391ac878dce75249d93fe8014 Mon Sep 17 00:00:00 2001 From: Luigi Baldoni Date: Tue, 14 Apr 2020 17:10:47 +0000 Subject: [PATCH 2/2] OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/fmt?expand=0&rev=20 --- fmt.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/fmt.spec b/fmt.spec index 720e443..3090022 100644 --- a/fmt.spec +++ b/fmt.spec @@ -22,7 +22,6 @@ Version: 6.2.0 Release: 0 Summary: A formatting library for C++ License: MIT -Group: System/Libraries URL: http://fmtlib.net/ Source0: https://github.com/fmtlib/fmt/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: baselibs.conf