From cf0c1df311748d688e19607203977f6ad125110c8c673b50f7192d8884481535 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 5 Jul 2022 14:39:24 +0000 Subject: [PATCH 1/3] - Update to release 9 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/fmt?expand=0&rev=46 --- baselibs.conf | 2 +- fmt-8.1.1.tar.gz | 3 --- fmt-9.0.0.tar.gz | 3 +++ fmt.changes | 24 ++++++++++++++++++++++++ fmt.spec | 8 ++++---- 5 files changed, 32 insertions(+), 8 deletions(-) delete mode 100644 fmt-8.1.1.tar.gz create mode 100644 fmt-9.0.0.tar.gz diff --git a/baselibs.conf b/baselibs.conf index c533e55..9e3eeee 100644 --- a/baselibs.conf +++ b/baselibs.conf @@ -1 +1 @@ -libfmt8 +libfmt9 diff --git a/fmt-8.1.1.tar.gz b/fmt-8.1.1.tar.gz deleted file mode 100644 index cb9137e..0000000 --- a/fmt-8.1.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3d794d3cf67633b34b2771eb9f073bde87e846e0d395d254df7b211ef1ec7346 -size 826254 diff --git a/fmt-9.0.0.tar.gz b/fmt-9.0.0.tar.gz new file mode 100644 index 0000000..f1a5fc0 --- /dev/null +++ b/fmt-9.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a1e0e9e843a356d65c7604e2c8bf9402b50fe294c355de0095ebd42fb9bd2c5 +size 833639 diff --git a/fmt.changes b/fmt.changes index 9fe0951..d005c94 100644 --- a/fmt.changes +++ b/fmt.changes @@ -1,3 +1,27 @@ +------------------------------------------------------------------- +Tue Jul 5 14:16:23 UTC 2022 - Jan Engelhardt + +- Update to release 9 + * Switched to the internal floating point formatter for all + decimal presentation formats. In particular this results in + consistent rounding on all platforms and removing the + s[n]printf fallback for decimal FP formatting. + * Compile-time floating point formatting no longer requires the + header-only mode. + * Disabled automatic std::ostream insertion operator + (operator<<) discovery when fmt/ostream.h is included to + prevent ODR violations. You can get the old behavior by + defining FMT_DEPRECATED_OSTREAM. + * Added fmt::ostream_formatter that can be used to write + formatter specializations that perform formatting via + std::ostream. + * Added the fmt::streamed function that takes an object and + formats it via std::ostream. + * Added experimental std::variant formatting support. + * Added experimental std::filesystem::path formatting support. + * Added a std::thread::id formatter to fmt/std.h. + * Added support for nested specifiers to range formatting. + ------------------------------------------------------------------- Sat Apr 30 12:01:50 UTC 2022 - Jan Engelhardt diff --git a/fmt.spec b/fmt.spec index 0369031..2367e2c 100644 --- a/fmt.spec +++ b/fmt.spec @@ -16,18 +16,18 @@ # -%define sover 8 +%define sover 9 Name: fmt -Version: 8.1.1 +Version: 9.0.0 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 +BuildRequires: c++_compiler BuildRequires: cmake -BuildRequires: gcc-c++ -BuildRequires: pkgconfig +BuildRequires: pkg-config %description Fmt is a formatting library for C++. It can be used as an From 422272881a06b89c6ba3760c8b271c91166433c0cafb615e63f20f3dad0e5a09 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 13 Jul 2022 22:13:51 +0000 Subject: [PATCH 2/3] - Add 0001-Fix-large-shift-in-uint128_fallback.patch 0002-Use-FMT_USE_FLOAT128-instead-of-__SIZEOF_FLOAT128__.patch 0001-Make-sure-the-correct-fmod-overload-is-called.patch OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/fmt?expand=0&rev=47 --- ...-Fix-large-shift-in-uint128_fallback.patch | 52 +++++++++++++++++++ ...-the-correct-fmod-overload-is-called.patch | 25 +++++++++ ...AT128-instead-of-__SIZEOF_FLOAT128__.patch | 34 ++++++++++++ fmt.changes | 3 ++ fmt.spec | 3 ++ 5 files changed, 117 insertions(+) create mode 100644 0001-Fix-large-shift-in-uint128_fallback.patch create mode 100644 0001-Make-sure-the-correct-fmod-overload-is-called.patch create mode 100644 0002-Use-FMT_USE_FLOAT128-instead-of-__SIZEOF_FLOAT128__.patch diff --git a/0001-Fix-large-shift-in-uint128_fallback.patch b/0001-Fix-large-shift-in-uint128_fallback.patch new file mode 100644 index 0000000..6486213 --- /dev/null +++ b/0001-Fix-large-shift-in-uint128_fallback.patch @@ -0,0 +1,52 @@ +From 2a1b3ac629bfec51ce70d3c0ebaf28e706754e19 Mon Sep 17 00:00:00 2001 +From: Victor Zverovich +Date: Sun, 10 Jul 2022 08:14:18 -0700 +Subject: [PATCH 1/2] Fix large shift in uint128_fallback + +--- + include/fmt/format.h | 2 ++ + test/format-test.cc | 4 +++- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/include/fmt/format.h b/include/fmt/format.h +index 0bd2fdb1..6516975e 100644 +--- a/include/fmt/format.h ++++ b/include/fmt/format.h +@@ -366,10 +366,12 @@ class uint128_fallback { + } + FMT_CONSTEXPR auto operator>>(int shift) const -> uint128_fallback { + if (shift == 64) return {0, hi_}; ++ if (shift > 64) return uint128_fallback(0, hi_) >> (shift - 64); + return {hi_ >> shift, (hi_ << (64 - shift)) | (lo_ >> shift)}; + } + FMT_CONSTEXPR auto operator<<(int shift) const -> uint128_fallback { + if (shift == 64) return {lo_, 0}; ++ if (shift > 64) return uint128_fallback(lo_, 0) << (shift - 64); + return {hi_ << shift | (lo_ >> (64 - shift)), (lo_ << shift)}; + } + FMT_CONSTEXPR auto operator>>=(int shift) -> uint128_fallback& { +diff --git a/test/format-test.cc b/test/format-test.cc +index 45a92624..8c1c305f 100644 +--- a/test/format-test.cc ++++ b/test/format-test.cc +@@ -59,6 +59,8 @@ TEST(uint128_test, shift) { + EXPECT_EQ(static_cast(n), 0x8000000000000000); + n = n >> 62; + EXPECT_EQ(static_cast(n), 42); ++ EXPECT_EQ(uint128_fallback(1) << 112, uint128_fallback(0x1000000000000, 0)); ++ EXPECT_EQ(uint128_fallback(0x1000000000000, 0) >> 112, uint128_fallback(1)); + } + + TEST(uint128_test, minus) { +@@ -234,7 +236,7 @@ TEST(util_test, format_system_error) { + throws_on_alloc = true; + } + if (!throws_on_alloc) { +- fmt::print("warning: std::allocator allocates {} chars", max_size); ++ fmt::print("warning: std::allocator allocates {} chars\n", max_size); + return; + } + } +-- +2.36.1 + diff --git a/0001-Make-sure-the-correct-fmod-overload-is-called.patch b/0001-Make-sure-the-correct-fmod-overload-is-called.patch new file mode 100644 index 0000000..0c7804b --- /dev/null +++ b/0001-Make-sure-the-correct-fmod-overload-is-called.patch @@ -0,0 +1,25 @@ +From d82e1a108d3b3e3e7b8b019b47df9c4ed127723b Mon Sep 17 00:00:00 2001 +From: Victor Zverovich +Date: Wed, 13 Jul 2022 12:33:57 -0700 +Subject: [PATCH] Make sure the correct fmod overload is called + +--- + include/fmt/chrono.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h +index 9b2aa74d..4a2c3a3d 100644 +--- a/include/fmt/chrono.h ++++ b/include/fmt/chrono.h +@@ -1777,7 +1777,7 @@ struct chrono_formatter { + format_to(std::back_inserter(buf), runtime("{:.{}f}"), + std::fmod(val * static_cast(Period::num) / + static_cast(Period::den), +- 60), ++ static_cast(60)), + num_fractional_digits); + if (negative) *out++ = '-'; + if (buf.size() < 2 || buf[1] == '.') *out++ = '0'; +-- +2.36.1 + diff --git a/0002-Use-FMT_USE_FLOAT128-instead-of-__SIZEOF_FLOAT128__.patch b/0002-Use-FMT_USE_FLOAT128-instead-of-__SIZEOF_FLOAT128__.patch new file mode 100644 index 0000000..7c79f94 --- /dev/null +++ b/0002-Use-FMT_USE_FLOAT128-instead-of-__SIZEOF_FLOAT128__.patch @@ -0,0 +1,34 @@ +From 05be7a0764f8fbfbdf9c9750ec54d49fe3d2419f Mon Sep 17 00:00:00 2001 +From: Victor Zverovich +Date: Sun, 10 Jul 2022 08:47:16 -0700 +Subject: [PATCH 2/2] Use FMT_USE_FLOAT128 instead of __SIZEOF_FLOAT128__ + +--- + test/format-test.cc | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/test/format-test.cc b/test/format-test.cc +index 8c1c305f..4ec7c838 100644 +--- a/test/format-test.cc ++++ b/test/format-test.cc +@@ -101,7 +101,7 @@ template void check_isfinite() { + + TEST(float_test, isfinite) { + check_isfinite(); +-#ifdef __SIZEOF_FLOAT128__ ++#if FMT_USE_FLOAT128 + check_isfinite(); + #endif + } +@@ -122,7 +122,7 @@ template void check_isnan() { + + TEST(float_test, isnan) { + check_isnan(); +-#ifdef __SIZEOF_FLOAT128__ ++#if FMT_USE_FLOAT128 + check_isnan(); + #endif + } +-- +2.36.1 + diff --git a/fmt.changes b/fmt.changes index d005c94..7aeed75 100644 --- a/fmt.changes +++ b/fmt.changes @@ -21,6 +21,9 @@ Tue Jul 5 14:16:23 UTC 2022 - Jan Engelhardt * Added experimental std::filesystem::path formatting support. * Added a std::thread::id formatter to fmt/std.h. * Added support for nested specifiers to range formatting. +- Add 0001-Fix-large-shift-in-uint128_fallback.patch + 0002-Use-FMT_USE_FLOAT128-instead-of-__SIZEOF_FLOAT128__.patch + 0001-Make-sure-the-correct-fmod-overload-is-called.patch ------------------------------------------------------------------- Sat Apr 30 12:01:50 UTC 2022 - Jan Engelhardt diff --git a/fmt.spec b/fmt.spec index 2367e2c..b439157 100644 --- a/fmt.spec +++ b/fmt.spec @@ -25,6 +25,9 @@ License: MIT URL: http://fmtlib.net/ Source0: https://github.com/fmtlib/fmt/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: baselibs.conf +Patch1: 0001-Fix-large-shift-in-uint128_fallback.patch +Patch2: 0002-Use-FMT_USE_FLOAT128-instead-of-__SIZEOF_FLOAT128__.patch +Patch3: 0001-Make-sure-the-correct-fmod-overload-is-called.patch BuildRequires: c++_compiler BuildRequires: cmake BuildRequires: pkg-config From 2c7995fa56103f841860a7abf4555eb02ac178b3020af2537a5114a9bcf18566 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sun, 28 Aug 2022 06:39:29 +0000 Subject: [PATCH 3/3] - Update to release 9.1 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/fmt?expand=0&rev=48 --- ...-Fix-large-shift-in-uint128_fallback.patch | 52 ------------------- ...-the-correct-fmod-overload-is-called.patch | 25 --------- ...AT128-instead-of-__SIZEOF_FLOAT128__.patch | 34 ------------ 9.1.0.tar.gz | 3 ++ fmt-9.0.0.tar.gz | 3 -- fmt.changes | 14 +++++ fmt.spec | 7 +-- 7 files changed, 19 insertions(+), 119 deletions(-) delete mode 100644 0001-Fix-large-shift-in-uint128_fallback.patch delete mode 100644 0001-Make-sure-the-correct-fmod-overload-is-called.patch delete mode 100644 0002-Use-FMT_USE_FLOAT128-instead-of-__SIZEOF_FLOAT128__.patch create mode 100644 9.1.0.tar.gz delete mode 100644 fmt-9.0.0.tar.gz diff --git a/0001-Fix-large-shift-in-uint128_fallback.patch b/0001-Fix-large-shift-in-uint128_fallback.patch deleted file mode 100644 index 6486213..0000000 --- a/0001-Fix-large-shift-in-uint128_fallback.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 2a1b3ac629bfec51ce70d3c0ebaf28e706754e19 Mon Sep 17 00:00:00 2001 -From: Victor Zverovich -Date: Sun, 10 Jul 2022 08:14:18 -0700 -Subject: [PATCH 1/2] Fix large shift in uint128_fallback - ---- - include/fmt/format.h | 2 ++ - test/format-test.cc | 4 +++- - 2 files changed, 5 insertions(+), 1 deletion(-) - -diff --git a/include/fmt/format.h b/include/fmt/format.h -index 0bd2fdb1..6516975e 100644 ---- a/include/fmt/format.h -+++ b/include/fmt/format.h -@@ -366,10 +366,12 @@ class uint128_fallback { - } - FMT_CONSTEXPR auto operator>>(int shift) const -> uint128_fallback { - if (shift == 64) return {0, hi_}; -+ if (shift > 64) return uint128_fallback(0, hi_) >> (shift - 64); - return {hi_ >> shift, (hi_ << (64 - shift)) | (lo_ >> shift)}; - } - FMT_CONSTEXPR auto operator<<(int shift) const -> uint128_fallback { - if (shift == 64) return {lo_, 0}; -+ if (shift > 64) return uint128_fallback(lo_, 0) << (shift - 64); - return {hi_ << shift | (lo_ >> (64 - shift)), (lo_ << shift)}; - } - FMT_CONSTEXPR auto operator>>=(int shift) -> uint128_fallback& { -diff --git a/test/format-test.cc b/test/format-test.cc -index 45a92624..8c1c305f 100644 ---- a/test/format-test.cc -+++ b/test/format-test.cc -@@ -59,6 +59,8 @@ TEST(uint128_test, shift) { - EXPECT_EQ(static_cast(n), 0x8000000000000000); - n = n >> 62; - EXPECT_EQ(static_cast(n), 42); -+ EXPECT_EQ(uint128_fallback(1) << 112, uint128_fallback(0x1000000000000, 0)); -+ EXPECT_EQ(uint128_fallback(0x1000000000000, 0) >> 112, uint128_fallback(1)); - } - - TEST(uint128_test, minus) { -@@ -234,7 +236,7 @@ TEST(util_test, format_system_error) { - throws_on_alloc = true; - } - if (!throws_on_alloc) { -- fmt::print("warning: std::allocator allocates {} chars", max_size); -+ fmt::print("warning: std::allocator allocates {} chars\n", max_size); - return; - } - } --- -2.36.1 - diff --git a/0001-Make-sure-the-correct-fmod-overload-is-called.patch b/0001-Make-sure-the-correct-fmod-overload-is-called.patch deleted file mode 100644 index 0c7804b..0000000 --- a/0001-Make-sure-the-correct-fmod-overload-is-called.patch +++ /dev/null @@ -1,25 +0,0 @@ -From d82e1a108d3b3e3e7b8b019b47df9c4ed127723b Mon Sep 17 00:00:00 2001 -From: Victor Zverovich -Date: Wed, 13 Jul 2022 12:33:57 -0700 -Subject: [PATCH] Make sure the correct fmod overload is called - ---- - include/fmt/chrono.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h -index 9b2aa74d..4a2c3a3d 100644 ---- a/include/fmt/chrono.h -+++ b/include/fmt/chrono.h -@@ -1777,7 +1777,7 @@ struct chrono_formatter { - format_to(std::back_inserter(buf), runtime("{:.{}f}"), - std::fmod(val * static_cast(Period::num) / - static_cast(Period::den), -- 60), -+ static_cast(60)), - num_fractional_digits); - if (negative) *out++ = '-'; - if (buf.size() < 2 || buf[1] == '.') *out++ = '0'; --- -2.36.1 - diff --git a/0002-Use-FMT_USE_FLOAT128-instead-of-__SIZEOF_FLOAT128__.patch b/0002-Use-FMT_USE_FLOAT128-instead-of-__SIZEOF_FLOAT128__.patch deleted file mode 100644 index 7c79f94..0000000 --- a/0002-Use-FMT_USE_FLOAT128-instead-of-__SIZEOF_FLOAT128__.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 05be7a0764f8fbfbdf9c9750ec54d49fe3d2419f Mon Sep 17 00:00:00 2001 -From: Victor Zverovich -Date: Sun, 10 Jul 2022 08:47:16 -0700 -Subject: [PATCH 2/2] Use FMT_USE_FLOAT128 instead of __SIZEOF_FLOAT128__ - ---- - test/format-test.cc | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/test/format-test.cc b/test/format-test.cc -index 8c1c305f..4ec7c838 100644 ---- a/test/format-test.cc -+++ b/test/format-test.cc -@@ -101,7 +101,7 @@ template void check_isfinite() { - - TEST(float_test, isfinite) { - check_isfinite(); --#ifdef __SIZEOF_FLOAT128__ -+#if FMT_USE_FLOAT128 - check_isfinite(); - #endif - } -@@ -122,7 +122,7 @@ template void check_isnan() { - - TEST(float_test, isnan) { - check_isnan(); --#ifdef __SIZEOF_FLOAT128__ -+#if FMT_USE_FLOAT128 - check_isnan(); - #endif - } --- -2.36.1 - diff --git a/9.1.0.tar.gz b/9.1.0.tar.gz new file mode 100644 index 0000000..3f652c1 --- /dev/null +++ b/9.1.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5dea48d1fcddc3ec571ce2058e13910a0d4a6bab4cc09a809d8b1dd1c88ae6f2 +size 837901 diff --git a/fmt-9.0.0.tar.gz b/fmt-9.0.0.tar.gz deleted file mode 100644 index f1a5fc0..0000000 --- a/fmt-9.0.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9a1e0e9e843a356d65c7604e2c8bf9402b50fe294c355de0095ebd42fb9bd2c5 -size 833639 diff --git a/fmt.changes b/fmt.changes index 7aeed75..d471cf1 100644 --- a/fmt.changes +++ b/fmt.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Sun Aug 28 06:35:23 UTC 2022 - Jan Engelhardt + +- Update to release 9.1 + * fmt::formatted_size now works at compile time + * Fixed handling of invalid UTF-8 (#3038) + * Improved Unicode support in ostream overloads of print + * Added support for wide streams to fmt::streamed + * Added the n specifier that disables the output of delimiters + when formatting ranges (#2981) +- Delete 0001-Fix-large-shift-in-uint128_fallback.patch + 0002-Use-FMT_USE_FLOAT128-instead-of-__SIZEOF_FLOAT128__.patch + 0001-Make-sure-the-correct-fmod-overload-is-called.patch (merged) + ------------------------------------------------------------------- Tue Jul 5 14:16:23 UTC 2022 - Jan Engelhardt diff --git a/fmt.spec b/fmt.spec index b439157..946afcf 100644 --- a/fmt.spec +++ b/fmt.spec @@ -18,16 +18,13 @@ %define sover 9 Name: fmt -Version: 9.0.0 +Version: 9.1.0 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 +Source: https://github.com/fmtlib/fmt/archive/%version.tar.gz Source1: baselibs.conf -Patch1: 0001-Fix-large-shift-in-uint128_fallback.patch -Patch2: 0002-Use-FMT_USE_FLOAT128-instead-of-__SIZEOF_FLOAT128__.patch -Patch3: 0001-Make-sure-the-correct-fmod-overload-is-called.patch BuildRequires: c++_compiler BuildRequires: cmake BuildRequires: pkg-config