aboutsummaryrefslogtreecommitdiff
path: root/libs/libfmt/patches
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2024-02-18 13:48:49 -0800
committerRosen Penev <rosenp@gmail.com>2024-02-18 15:39:04 -0800
commitb111a290d8692e8fb13ebd3191378ae551bf6084 (patch)
treec2a26951d6668d46651b529625545a793ea442cd /libs/libfmt/patches
parentd30a34bac1376a90f5767bfefa6e5eeaf4a945a7 (diff)
libfmt: fix compilation with mariadb
Upstream backport. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'libs/libfmt/patches')
-rw-r--r--libs/libfmt/patches/010-static.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/libs/libfmt/patches/010-static.patch b/libs/libfmt/patches/010-static.patch
new file mode 100644
index 000000000..27bfda2a4
--- /dev/null
+++ b/libs/libfmt/patches/010-static.patch
@@ -0,0 +1,32 @@
+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
+