From 7604a5a8badacd11057c667de120ca557d145097 Mon Sep 17 00:00:00 2001 From: Wongboo Date: Fri, 23 Sep 2022 18:05:02 +0800 Subject: [PATCH] fmtlib: updated to 9.1.0 9.1.0 - 2022-08-27 ------------------ * ``fmt::formatted_size`` now works at compile time . For example (`godbolt `__): .. code:: c++ #include int main() { using namespace fmt::literals; constexpr size_t n = fmt::formatted_size("{}"_cf, 42); fmt::print("{}\n", n); // prints 2 } * Fixed handling of invalid UTF-8. * Improved Unicode support in ``ostream`` overloads of ``print``. * Fixed handling of the sign specifier in localized formatting on systems with 32-bit ``wchar_t`` . * Added support for wide streams to ``fmt::streamed``. * Added the ``n`` specifier that disables the output of delimiters when formatting ranges. For example (`godbolt `__): .. code:: c++ #include #include int main() { auto v = std::vector{1, 2, 3}; fmt::print("{:n}\n", v); // prints 1, 2, 3 } * Worked around problematic ``std::string_view`` constructors introduced in C++23 * Improve handling (exclusion) of recursive ranges * Improved error reporting in format string compilation. * Improved the implementation of `Dragonbox `_, the algorithm used for the default floating-point formatting. * Fixed issues with floating-point formatting on exotic platforms. * Improved the implementation of chrono formatting. * Improved documentation. * Improved build configuration. * Fixed various warnings and compilation issues. 9.0.0 - 2022-07-04 ------------------ * 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. For example (`godbolt `__): .. code:: c++ #include #include consteval auto compile_time_dtoa(double value) -> std::array { auto result = std::array(); fmt::format_to(result.data(), FMT_COMPILE("{}"), value); return result; } constexpr auto answer = compile_time_dtoa(0.42); works with the default settings. * Improved the implementation of `Dragonbox `_, the algorithm used for the default floating-point formatting. * Made ``fmt::to_string`` work with ``__float128``. This uses the internal FP formatter and works even on system without ``__float128`` support in ``[s]printf``. * 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`` but this will be removed in the next major release. Use ``fmt::streamed`` or ``fmt::ostream_formatter`` to enable formatting via ``std::ostream`` instead. * Added ``fmt::ostream_formatter`` that can be used to write ``formatter`` specializations that perform formatting via ``std::ostream``. For example (`godbolt `__): .. code:: c++ #include struct date { int year, month, day; friend std::ostream& operator<<(std::ostream& os, const date& d) { return os << d.year << '-' << d.month << '-' << d.day; } }; template <> struct fmt::formatter : ostream_formatter {}; std::string s = fmt::format("The date is {}", date{2012, 12, 9}); // s == "The date is 2012-12-9" * Added the ``fmt::streamed`` function that takes an object and formats it via ``std::ostream``. For example (`godbolt `__): .. code:: c++ #include #include int main() { fmt::print("Current thread id: {}\n", fmt::streamed(std::this_thread::get_id())); } Note that ``fmt/std.h`` provides a ``formatter`` specialization for ``std::thread::id`` so you don't need to format it via ``std::ostream``. * Deprecated implicit conversions of unscoped enums to integers for consistency with scoped enums. * Added an argument-dependent lookup based ``format_as`` extension API to simplify formatting of enums. * Added experimental ``std::variant`` formatting support. For example (`godbolt `__): .. code:: c++ #include #include int main() { auto v = std::variant(42); fmt::print("{}\n", v); } prints:: variant(42) Thanks `@jehelset `_. * Added experimental ``std::filesystem::path`` formatting support (`#2865 `_, `#2902 `_, `#2917 `_, `#2918 `_). For example (`godbolt `__): .. code:: c++ #include #include int main() { fmt::print("There is no place like {}.", std::filesystem::path("/home")); } prints:: There is no place like "/home". * Added a ``std::thread::id`` formatter to ``fmt/std.h``. For example (`godbolt `__): .. code:: c++ #include #include int main() { fmt::print("Current thread id: {}\n", std::this_thread::get_id()); } * Added ``fmt::styled`` that applies a text style to an individual argument. . For example (`godbolt `__): .. code:: c++ #include #include int main() { auto now = std::chrono::system_clock::now(); fmt::print( "[{}] {}: {}\n", fmt::styled(now, fmt::emphasis::bold), fmt::styled("error", fg(fmt::color::red)), "something went wrong"); } * Made ``fmt::print`` overload for text styles correctly handle UTF-8. * Fixed Unicode handling when writing to an ostream. * Added support for nested specifiers to range formatting: .. code:: c++ #include #include int main() { fmt::print("{::#x}\n", std::vector{10, 20, 30}); } prints ``[0xa, 0x14, 0x1e]``. * Implemented escaping of wide strings in ranges. * Added support for ranges with ``begin`` / ``end`` found via the argument-dependent lookup. * Fixed formatting of certain kinds of ranges of ranges. * Fixed handling of maps with element types other than ``std::pair``. * Made tuple formatter enabled only if elements are formattable. * Made ``fmt::join`` compatible with format string compilation. * Made compile-time checks work with named arguments of custom types and ``std::ostream`` ``print`` overloads. * Removed ``make_args_checked`` because it is no longer needed for compile-time. * Removed the following deprecated APIs: ``_format``, ``arg_join``, the ``format_to`` overload that takes a memory buffer, ``[v]fprintf`` that takes an ``ostream``. * Removed the deprecated implicit conversion of ``[const] signed char*`` and ``[const] unsigned char*`` to C strings. * Removed the deprecated ``fmt/locale.h``. * Replaced the deprecated ``fileno()`` with ``descriptor()`` in ``buffered_file``. * Moved ``to_string_view`` to the ``detail`` namespace since it's an implementation detail. * Made access mode of a created file consistent with ``fopen`` by setting ``S_IWGRP`` and ``S_IWOTH``. * Removed a redundant buffer resize when formatting to ``std::ostream``. * Made precision computation for strings consistent with width. . * Fixed handling of locale separators in floating point formatting. * Made sign specifiers work with ``__int128_t``. * Improved support for systems such as CHERI with extra data stored in pointers. * Improved documentation. * Improved build configuration. * Fixed various warnings and compilation issues. --- textproc/fmtlib/Makefile | 4 ++-- textproc/fmtlib/PLIST | 6 +++--- textproc/fmtlib/distinfo | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/textproc/fmtlib/Makefile b/textproc/fmtlib/Makefile index c8c6d7a15475..e4e3e9d087b4 100644 --- a/textproc/fmtlib/Makefile +++ b/textproc/fmtlib/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.11 2022/01/07 21:16:09 adam Exp $ +# $NetBSD: Makefile,v 1.12 2022/09/23 16:35:51 Wongboo Exp $ -DISTNAME= fmt-8.1.1 +DISTNAME= fmt-9.1.0 PKGNAME= ${DISTNAME:S/fmt/fmtlib/} CATEGORIES= textproc MASTER_SITES= ${MASTER_SITE_GITHUB:=fmtlib/} diff --git a/textproc/fmtlib/PLIST b/textproc/fmtlib/PLIST index 4a195873f286..158560dc81eb 100644 --- a/textproc/fmtlib/PLIST +++ b/textproc/fmtlib/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.7 2021/07/14 07:31:10 adam Exp $ +@comment $NetBSD: PLIST,v 1.8 2022/09/23 16:35:51 Wongboo Exp $ include/fmt/args.h include/fmt/chrono.h include/fmt/color.h @@ -6,7 +6,7 @@ include/fmt/compile.h include/fmt/core.h include/fmt/format-inl.h include/fmt/format.h -include/fmt/locale.h +include/fmt/std.h include/fmt/os.h include/fmt/ostream.h include/fmt/printf.h @@ -18,5 +18,5 @@ lib/cmake/fmt/fmt-targets-release.cmake lib/cmake/fmt/fmt-targets.cmake lib/libfmt.so lib/libfmt.so.${PKGVERSION} -lib/libfmt.so.8 +lib/libfmt.so.9 lib/pkgconfig/fmt.pc diff --git a/textproc/fmtlib/distinfo b/textproc/fmtlib/distinfo index a6c7bcc82f21..305760e9557c 100644 --- a/textproc/fmtlib/distinfo +++ b/textproc/fmtlib/distinfo @@ -1,5 +1,5 @@ -$NetBSD: distinfo,v 1.14 2022/01/07 21:16:09 adam Exp $ +$NetBSD: distinfo,v 1.15 2022/09/23 16:35:51 Wongboo Exp $ -BLAKE2s (fmt-8.1.1.tar.gz) = 995c9b11fe27b6c33a3c34aa2475f9020da5fb48fbbcd6da1f0aac761c53ee5c -SHA512 (fmt-8.1.1.tar.gz) = 794a47d7cb352a2a9f2c050a60a46b002e4157e5ad23e15a5afc668e852b1e1847aeee3cda79e266c789ff79310d792060c94976ceef6352e322d60b94e23189 -Size (fmt-8.1.1.tar.gz) = 826254 bytes +BLAKE2s (fmt-9.1.0.tar.gz) = dad20e52d2213496228f5ef7c4f2f02007ec8df90bf2b1ce0fda5149e43da49d +SHA512 (fmt-9.1.0.tar.gz) = a18442042722dd48e20714ec034a12fcc0576c9af7be5188586970e2edf47529825bdc99af366b1d5891630c8dbf6f63bfa9f012e77ab3d3ed80d1a118e3b2be +Size (fmt-9.1.0.tar.gz) = 837901 bytes