public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH v2] fmt: Get rid of std::copy
@ 2024-08-29 16:58 Khem Raj
  2024-08-29 17:19 ` Patchtest results for " patchtest
  0 siblings, 1 reply; 2+ messages in thread
From: Khem Raj @ 2024-08-29 16:58 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Use an upstream fix instead of own

 .../fmt/fmt/0001-Get-rid-of-std-copy.patch    | 52 +++++++++++++++++++
 meta/recipes-devtools/fmt/fmt_11.0.2.bb       |  4 +-
 2 files changed, 55 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/fmt/fmt/0001-Get-rid-of-std-copy.patch

diff --git a/meta/recipes-devtools/fmt/fmt/0001-Get-rid-of-std-copy.patch b/meta/recipes-devtools/fmt/fmt/0001-Get-rid-of-std-copy.patch
new file mode 100644
index 00000000000..1b495ea075c
--- /dev/null
+++ b/meta/recipes-devtools/fmt/fmt/0001-Get-rid-of-std-copy.patch
@@ -0,0 +1,52 @@
+From 6e462b89aa22fd5f737ed162d0150e145ccb1914 Mon Sep 17 00:00:00 2001
+From: Victor Zverovich <viz@meta.com>
+Date: Mon, 29 Jul 2024 15:58:05 -0700
+Subject: [PATCH] Get rid of std::copy
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [https://github.com/fmtlib/fmt/commit/6e462b89aa22fd5f737ed162d0150e145ccb1914]
+---
+ include/fmt/color.h | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/include/fmt/color.h b/include/fmt/color.h
+index f0e9dd94..231d93c8 100644
+--- a/include/fmt/color.h
++++ b/include/fmt/color.h
+@@ -560,31 +560,30 @@ struct formatter<detail::styled_arg<T>, Char> : formatter<T, Char> {
+   auto format(const detail::styled_arg<T>& arg, FormatContext& ctx) const
+       -> decltype(ctx.out()) {
+     const auto& ts = arg.style;
+-    const auto& value = arg.value;
+     auto out = ctx.out();
+ 
+     bool has_style = false;
+     if (ts.has_emphasis()) {
+       has_style = true;
+       auto emphasis = detail::make_emphasis<Char>(ts.get_emphasis());
+-      out = std::copy(emphasis.begin(), emphasis.end(), out);
++      out = detail::copy<Char>(emphasis.begin(), emphasis.end(), out);
+     }
+     if (ts.has_foreground()) {
+       has_style = true;
+       auto foreground =
+           detail::make_foreground_color<Char>(ts.get_foreground());
+-      out = std::copy(foreground.begin(), foreground.end(), out);
++      out = detail::copy<Char>(foreground.begin(), foreground.end(), out);
+     }
+     if (ts.has_background()) {
+       has_style = true;
+       auto background =
+           detail::make_background_color<Char>(ts.get_background());
+-      out = std::copy(background.begin(), background.end(), out);
++      out = detail::copy<Char>(background.begin(), background.end(), out);
+     }
+-    out = formatter<T, Char>::format(value, ctx);
++    out = formatter<T, Char>::format(arg.value, ctx);
+     if (has_style) {
+       auto reset_color = string_view("\x1b[0m");
+-      out = std::copy(reset_color.begin(), reset_color.end(), out);
++      out = detail::copy<Char>(reset_color.begin(), reset_color.end(), out);
+     }
+     return out;
+   }
diff --git a/meta/recipes-devtools/fmt/fmt_11.0.2.bb b/meta/recipes-devtools/fmt/fmt_11.0.2.bb
index 5a7041088cd..5c60921efae 100644
--- a/meta/recipes-devtools/fmt/fmt_11.0.2.bb
+++ b/meta/recipes-devtools/fmt/fmt_11.0.2.bb
@@ -4,7 +4,9 @@ HOMEPAGE = "https://fmt.dev"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=b9257785fc4f3803a4b71b76c1412729"
 
-SRC_URI = "git://github.com/fmtlib/fmt;branch=master;protocol=https"
+SRC_URI = "git://github.com/fmtlib/fmt;branch=master;protocol=https \
+           file://0001-Get-rid-of-std-copy.patch \
+           "
 SRCREV = "0c9fce2ffefecfdce794e1859584e25877b7b592"
 
 S = "${WORKDIR}/git"


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-29 17:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-29 16:58 [PATCH v2] fmt: Get rid of std::copy Khem Raj
2024-08-29 17:19 ` Patchtest results for " patchtest

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox