Accepting request 802984 from home:alois:branches:devel:libraries:c_c++
- Update to version 6.2.1 * Fixed ostream support in ``sprintf`` (`#1631 <https://github.com/fmtlib/fmt/issues/1631>`_). * Fixed type detection when using implicit conversion to ``string_view`` and ostream ``operator<<`` inconsistently (`#1662 <https://github.com/fmtlib/fmt/issues/1662>`_). - Drop 7d01859ef16e6b65bc023ad8bebfedecb088bf81.patch (no longer necessary) - Spec cleanup OBS-URL: https://build.opensuse.org/request/show/802984 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/fmt?expand=0&rev=22
This commit is contained in:
parent
fd7557086d
commit
92daef41ce
@ -1,46 +0,0 @@
|
||||
From 7d01859ef16e6b65bc023ad8bebfedecb088bf81 Mon Sep 17 00:00:00 2001
|
||||
From: Victor Zverovich <viz@fb.com>
|
||||
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 <typename Context> struct arg_mapper {
|
||||
static_assert(std::is_same<char_type, char>::value, "invalid string type");
|
||||
return reinterpret_cast<const char*>(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;
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fe6e4ff397e01c379fc4532519339c93da47404b9f6674184a458a9967a76575
|
||||
size 733403
|
3
fmt-6.2.1.tar.gz
Normal file
3
fmt-6.2.1.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5edf8b0f32135ad5fafb3064de26d063571e95e8ae46829c2f4f4b52696bbff0
|
||||
size 733646
|
13
fmt.changes
13
fmt.changes
@ -1,3 +1,16 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat May 9 17:53:02 UTC 2020 - Luigi Baldoni <aloisio@gmx.com>
|
||||
|
||||
- Update to version 6.2.1
|
||||
* Fixed ostream support in ``sprintf``
|
||||
(`#1631 <https://github.com/fmtlib/fmt/issues/1631>`_).
|
||||
* Fixed type detection when using implicit conversion to
|
||||
``string_view`` and ostream ``operator<<`` inconsistently
|
||||
(`#1662 <https://github.com/fmtlib/fmt/issues/1662>`_).
|
||||
- Drop 7d01859ef16e6b65bc023ad8bebfedecb088bf81.patch (no longer
|
||||
necessary)
|
||||
- Spec cleanup
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 14 13:04:56 UTC 2020 - Hans-Peter Jansen <hpj@urpla.net>
|
||||
|
||||
|
9
fmt.spec
9
fmt.spec
@ -18,14 +18,13 @@
|
||||
|
||||
%define sover 6
|
||||
Name: fmt
|
||||
Version: 6.2.0
|
||||
Version: 6.2.1
|
||||
Release: 0
|
||||
Summary: A formatting library for C++
|
||||
License: MIT
|
||||
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
|
||||
@ -36,14 +35,12 @@ alternative to (s)printf and IOStreams.
|
||||
|
||||
%package -n libfmt%{sover}
|
||||
Summary: A formatting library for C++
|
||||
Group: System/Libraries
|
||||
|
||||
%description -n libfmt%{sover}
|
||||
Shared library for fmt, a formatting library for C++.
|
||||
|
||||
%package devel
|
||||
Summary: Development files for fmt, a formatting library
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: libfmt%{sover} = %{version}
|
||||
|
||||
%description devel
|
||||
@ -69,11 +66,7 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir}
|
||||
%postun -n libfmt%{sover} -p /sbin/ldconfig
|
||||
|
||||
%files -n libfmt%{sover}
|
||||
%if 0%{?sle_version} > 120200
|
||||
%license LICENSE.rst
|
||||
%else
|
||||
%doc LICENSE.rst
|
||||
%endif
|
||||
%{_libdir}/libfmt.so.%{sover}*
|
||||
|
||||
%files devel
|
||||
|
Loading…
Reference in New Issue
Block a user