Skip to content
Snippets Groups Projects
Commit be4985b3 authored by Natanael Copa's avatar Natanael Copa
Browse files

main/fmt: backport fix for static separator

parent 61040399
No related branches found
No related tags found
No related merge requests found
...@@ -2,14 +2,15 @@ ...@@ -2,14 +2,15 @@
# Maintainer: Duncan Bellamy <dunk@denkimushi.com> # Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=fmt pkgname=fmt
pkgver=10.2.1 pkgver=10.2.1
pkgrel=0 pkgrel=1
pkgdesc="Open-source formatting library for C++" pkgdesc="Open-source formatting library for C++"
url="https://fmt.dev/latest/index.html" url="https://fmt.dev/latest/index.html"
arch="all" arch="all"
license="MIT" license="MIT"
makedepends="cmake doxygen python3 samurai" makedepends="cmake doxygen python3 samurai"
subpackages="$pkgname-dev $pkgname-doc" subpackages="$pkgname-dev $pkgname-doc"
source="https://github.com/fmtlib/fmt/releases/download/$pkgver/fmt-$pkgver.zip" source="https://github.com/fmtlib/fmt/releases/download/$pkgver/fmt-$pkgver.zip
Fix-handling-of-static-separator.patch"
build() { build() {
if [ "$CBUILD" != "$CHOST" ]; then if [ "$CBUILD" != "$CHOST" ]; then
...@@ -37,4 +38,5 @@ package() { ...@@ -37,4 +38,5 @@ package() {
sha512sums=" sha512sums="
1cf0e3dd09c7d87e0890b8743559159d3be2a8f33c135516962d17c4eeb7b00659e6acd74518bd5566ee4e83ddaba155fecb4c229f90cd258b3b832e72ad82cd fmt-10.2.1.zip 1cf0e3dd09c7d87e0890b8743559159d3be2a8f33c135516962d17c4eeb7b00659e6acd74518bd5566ee4e83ddaba155fecb4c229f90cd258b3b832e72ad82cd fmt-10.2.1.zip
695fb13dc60eea6ce83319d8925be49b3a7af6651d80ab528ed244e589c581ee05ac7887f6c73dbfcf2654afabd2c405c0e2eeb5f1f0851237b14d305185d7d5 Fix-handling-of-static-separator.patch
" "
From 44c3fe1ebb466ab5c296e1a1a6991c7c7b51b72e Mon Sep 17 00:00:00 2001
From: Victor Zverovich <viz@meta.com>
Date: Fri, 9 Feb 2024 15:58:56 -0800
Subject: [PATCH] Fix handling of static separator
---
include/fmt/format-inl.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- a/include/fmt/format-inl.h
+++ b/include/fmt/format-inl.h
@@ -114,7 +114,11 @@ template <typename Char> FMT_FUNC Char d
FMT_FUNC auto write_loc(appender out, loc_value value,
const format_specs<>& specs, locale_ref loc) -> bool {
-#ifndef FMT_STATIC_THOUSANDS_SEPARATOR
+#ifdef FMT_STATIC_THOUSANDS_SEPARATOR
+ value.visit(loc_writer<>{
+ out, specs, std::string(1, FMT_STATIC_THOUSANDS_SEPARATOR), "\3", "."});
+ return true;
+#else
auto locale = loc.get<std::locale>();
// We cannot use the num_put<char> facet because it may produce output in
// a wrong encoding.
@@ -123,7 +127,6 @@ FMT_FUNC auto write_loc(appender out, lo
return std::use_facet<facet>(locale).put(out, value, specs);
return facet(locale).put(out, value, specs);
#endif
- return false;
}
} // namespace detail
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment