From ce9f48e9d1f4e8701b977f9b6921bc3b71d51eb2 Mon Sep 17 00:00:00 2001 From: Vitaly Zaitsev Date: Fri, 7 Jan 2022 10:42:56 +0100 Subject: [PATCH] Updated to version 8.1.1. --- .gitignore | 1 + fmt-big-endian-fixes.patch | 68 -------------------------------------- fmt-on_error-abi-fix.patch | 27 --------------- fmt.spec | 13 +++----- sources | 2 +- 5 files changed, 7 insertions(+), 104 deletions(-) delete mode 100644 fmt-big-endian-fixes.patch delete mode 100644 fmt-on_error-abi-fix.patch diff --git a/.gitignore b/.gitignore index a01a906..cdfecb4 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ /7.1.3.tar.gz /8.0.1.tar.gz /8.1.0.tar.gz +/8.1.1.tar.gz diff --git a/fmt-big-endian-fixes.patch b/fmt-big-endian-fixes.patch deleted file mode 100644 index 3c94b9a..0000000 --- a/fmt-big-endian-fixes.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 214cf13f17c7177912cc8f9b6c070c4b3a282c36 Mon Sep 17 00:00:00 2001 -From: Vladislav Shchapov -Date: Wed, 5 Jan 2022 03:23:42 +0500 -Subject: [PATCH] Fix endianness bug in write_digit2_separated (#2699) - -* Fix endianness bug in write_digit2_separated - -* Move endianness check to compile time if it possible - -* Turn 8 into a constant ---- - include/fmt/chrono.h | 10 +++++++++- - include/fmt/format.h | 10 +++++++++- - 2 files changed, 18 insertions(+), 2 deletions(-) - -diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h -index 908999ab5f..682efd8d21 100644 ---- a/include/fmt/chrono.h -+++ b/include/fmt/chrono.h -@@ -558,7 +558,15 @@ inline void write_digit2_separated(char* buf, unsigned a, unsigned b, - auto usep = static_cast(sep); - // Add ASCII '0' to each digit byte and insert separators. - digits |= 0x3030003030003030 | (usep << 16) | (usep << 40); -- memcpy(buf, &digits, 8); -+ -+ constexpr const size_t len = 8; -+ if (const_check(is_big_endian())) { -+ char tmp[len]; -+ memcpy(tmp, &digits, len); -+ std::reverse_copy(tmp, tmp + len, buf); -+ } else { -+ memcpy(buf, &digits, len); -+ } - } - - template FMT_CONSTEXPR inline const char* get_units() { -diff --git a/include/fmt/format.h b/include/fmt/format.h -index a6f1fdc89e..8b789574ec 100644 ---- a/include/fmt/format.h -+++ b/include/fmt/format.h -@@ -296,10 +296,18 @@ FMT_CONSTEXPR20 auto bit_cast(const From& from) -> To { - } - - inline auto is_big_endian() -> bool { -+#ifdef _WIN32 -+ return false; -+#elif defined(__BIG_ENDIAN__) -+ return true; -+#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) -+ return __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__; -+#else - struct bytes { - char data[sizeof(int)]; - }; - return bit_cast(1).data[0] == 0; -+#endif - } - - // A fallback implementation of uintptr_t for systems that lack it. -@@ -309,7 +317,7 @@ struct fallback_uintptr { - fallback_uintptr() = default; - explicit fallback_uintptr(const void* p) { - *this = bit_cast(p); -- if (is_big_endian()) { -+ if (const_check(is_big_endian())) { - for (size_t i = 0, j = sizeof(void*) - 1; i < j; ++i, --j) - std::swap(value[i], value[j]); - } diff --git a/fmt-on_error-abi-fix.patch b/fmt-on_error-abi-fix.patch deleted file mode 100644 index f8332f9..0000000 --- a/fmt-on_error-abi-fix.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 17a5c808dad4bcf3a412c005314cad43609ae6ef Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Julian=20R=C3=BCth?= -Date: Tue, 4 Jan 2022 12:53:44 -0600 -Subject: [PATCH] Restore FMT_API on error_handler::on_error() (#2696) - -this fixes a breaking ABI change that was introduce in the upgrade from -8.0.1 to 8.1.0. - -Fixes #2695. ---- - include/fmt/core.h | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/include/fmt/core.h b/include/fmt/core.h -index 4efa21f11f..28b8ff648f 100644 ---- a/include/fmt/core.h -+++ b/include/fmt/core.h -@@ -615,7 +615,8 @@ struct error_handler { - constexpr error_handler(const error_handler&) = default; - - // This function is intentionally not constexpr to give a compile-time error. -- void on_error(const char* message) { throw_format_error(message); } -+ // This function is marked as FMT_API for backwards compatibility, see #2695. -+ FMT_NORETURN FMT_API void on_error(const char* message) { throw_format_error(message); } - }; - FMT_END_DETAIL_NAMESPACE - diff --git a/fmt.spec b/fmt.spec index 0d8ae48..f29bbc5 100644 --- a/fmt.spec +++ b/fmt.spec @@ -1,20 +1,14 @@ %undefine __cmake_in_source_build Name: fmt -Version: 8.1.0 -Release: 2%{?dist} +Version: 8.1.1 +Release: 1%{?dist} License: BSD Summary: Small, safe and fast formatting library for C++ URL: https://github.com/fmtlib/%{name} Source0: %{url}/archive/%{version}.tar.gz -# https://github.com/fmtlib/fmt/commit/214cf13f17c7177912cc8f9b6c070c4b3a282c36 -Patch100: %{name}-big-endian-fixes.patch - -# https://github.com/fmtlib/fmt/commit/17a5c808dad4bcf3a412c005314cad43609ae6ef -Patch101: %{name}-on_error-abi-fix.patch - BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: ninja-build @@ -77,6 +71,9 @@ This package contains the header file for using %{name}. %{_libdir}/pkgconfig/%{name}.pc %changelog +* Fri Jan 07 2022 Vitaly Zaitsev - 8.1.1-1 +- Updated to version 8.1.1. + * Wed Jan 05 2022 Vitaly Zaitsev - 8.1.0-2 - Updated Big Endian patch. - Added ABI fix patch. diff --git a/sources b/sources index 5c0143d..8a5aa90 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (8.1.0.tar.gz) = 63d052c6ba7ca53978ca42b8a72d8548eabae04064832bb79010f44f0276b31d0a2fc02d99b09a350ce514931afc387d5fe13c121344cad6d87fe4d504810d9f +SHA512 (8.1.1.tar.gz) = 794a47d7cb352a2a9f2c050a60a46b002e4157e5ad23e15a5afc668e852b1e1847aeee3cda79e266c789ff79310d792060c94976ceef6352e322d60b94e23189