diff options
| author | Khem Raj <raj.khem@gmail.com> | 2023-02-06 18:37:12 -0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2023-02-06 20:48:39 -0800 |
| commit | 26fb498ed3c980ea69913ce86edcd7e659095f1a (patch) | |
| tree | 3447583f046765863d686353db63d99388918c47 | |
| parent | ac69a017011bf14fcd45cd653e1c1c6396884e8e (diff) | |
| download | meta-openembedded-26fb498ed3c980ea69913ce86edcd7e659095f1a.tar.gz | |
oprofile: Do not use std::bind2nd
std::bind2nd is removed from c++17, therefore re-implement with generic
lambda
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-kernel/oprofile/oprofile/0001-Replace-std-bind2nd-with-generic-lambda.patch | 34 | ||||
| -rw-r--r-- | meta-oe/recipes-kernel/oprofile/oprofile_1.4.0.bb | 1 |
2 files changed, 35 insertions, 0 deletions
diff --git a/meta-oe/recipes-kernel/oprofile/oprofile/0001-Replace-std-bind2nd-with-generic-lambda.patch b/meta-oe/recipes-kernel/oprofile/oprofile/0001-Replace-std-bind2nd-with-generic-lambda.patch new file mode 100644 index 0000000000..930b90e289 --- /dev/null +++ b/meta-oe/recipes-kernel/oprofile/oprofile/0001-Replace-std-bind2nd-with-generic-lambda.patch | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | From 5d879cb4f23c613e16b3f479ab09bbb5ff340201 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Mon, 6 Feb 2023 17:02:41 -0800 | ||
| 4 | Subject: [PATCH] Replace std::bind2nd with generic lambda | ||
| 5 | |||
| 6 | std::bind2nd is gone in c++17, therefore stop using it and replace it | ||
| 7 | with generic lambda from c++14 onwards | ||
| 8 | |||
| 9 | Upstream-Status: Pending | ||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | --- | ||
| 12 | libutil++/growable_vector.h | 6 +++--- | ||
| 13 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/libutil++/growable_vector.h b/libutil++/growable_vector.h | ||
| 16 | index 350246a..9846e1e 100644 | ||
| 17 | --- a/libutil++/growable_vector.h | ||
| 18 | +++ b/libutil++/growable_vector.h | ||
| 19 | @@ -93,9 +93,9 @@ public: | ||
| 20 | |||
| 21 | /// return true if all elements have the default constructed value | ||
| 22 | bool zero() const { | ||
| 23 | - return std::find_if(container.begin(), container.end(), | ||
| 24 | - std::bind2nd(std::not_equal_to<T>(), T())) | ||
| 25 | - == container.end(); | ||
| 26 | + return std::find_if(begin(container), end(container), | ||
| 27 | + [&](auto const& elem) {return elem != T();}) | ||
| 28 | + == end(container); | ||
| 29 | } | ||
| 30 | |||
| 31 | private: | ||
| 32 | -- | ||
| 33 | 2.39.1 | ||
| 34 | |||
diff --git a/meta-oe/recipes-kernel/oprofile/oprofile_1.4.0.bb b/meta-oe/recipes-kernel/oprofile/oprofile_1.4.0.bb index e6eec0ab05..335ab48bb2 100644 --- a/meta-oe/recipes-kernel/oprofile/oprofile_1.4.0.bb +++ b/meta-oe/recipes-kernel/oprofile/oprofile_1.4.0.bb | |||
| @@ -31,6 +31,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \ | |||
| 31 | file://0009-Prevent-running-check-tests-on-host-if-cross-compili.patch \ | 31 | file://0009-Prevent-running-check-tests-on-host-if-cross-compili.patch \ |
| 32 | file://0010-oprofile-Determine-the-root-home-directory-dynamical.patch \ | 32 | file://0010-oprofile-Determine-the-root-home-directory-dynamical.patch \ |
| 33 | file://0001-configure-Include-unistd.h-for-getpid-API.patch \ | 33 | file://0001-configure-Include-unistd.h-for-getpid-API.patch \ |
| 34 | file://0001-Replace-std-bind2nd-with-generic-lambda.patch \ | ||
| 34 | " | 35 | " |
| 35 | SRC_URI[sha256sum] = "7ba06f99d7c188389d20d1d5e53ee690c7733f87aa9af62bd664fa0ca235a412" | 36 | SRC_URI[sha256sum] = "7ba06f99d7c188389d20d1d5e53ee690c7733f87aa9af62bd664fa0ca235a412" |
| 36 | 37 | ||
