summaryrefslogtreecommitdiffstats
path: root/meta-filesystems/recipes-utils
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-01-16 19:36:40 -0800
committerKhem Raj <raj.khem@gmail.com>2023-01-16 21:23:07 -0800
commit35cb8ca9252dcee9f84051481b68fd1e5757f616 (patch)
treed94cec29f140b4345555e8d3ad645fccb826bc15 /meta-filesystems/recipes-utils
parent83a00a54b6fbcfed74d2b3d96ccde5722cd028a2 (diff)
downloadmeta-openembedded-35cb8ca9252dcee9f84051481b68fd1e5757f616.tar.gz
fatcat: Fix build with std=c++17
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-filesystems/recipes-utils')
-rw-r--r--meta-filesystems/recipes-utils/fatcat/fatcat/0001-Replace-std-ptr_fun-for-c-17.patch48
-rw-r--r--meta-filesystems/recipes-utils/fatcat/fatcat_1.1.1.bb1
2 files changed, 49 insertions, 0 deletions
diff --git a/meta-filesystems/recipes-utils/fatcat/fatcat/0001-Replace-std-ptr_fun-for-c-17.patch b/meta-filesystems/recipes-utils/fatcat/fatcat/0001-Replace-std-ptr_fun-for-c-17.patch
new file mode 100644
index 000000000..277a368b6
--- /dev/null
+++ b/meta-filesystems/recipes-utils/fatcat/fatcat/0001-Replace-std-ptr_fun-for-c-17.patch
@@ -0,0 +1,48 @@
1From 455001cb0112f7324ab50f555aa5ed5eae1bb93b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 16 Jan 2023 19:23:18 -0800
4Subject: [PATCH] Replace std::ptr_fun for c++17
5
6std::ptr_fun was deprecated in C++11, and removed completely in C++17.
7Similarly, std::not1 is deprecated since C++17.
8
9Modern compilers like clang >= 16 have started to notice it
10
11src/FatUtils.h:41:46: error: use of undeclared identifier 'ptr_fun'
12| s.erase(find_if(s.rbegin(), s.rend(), not1(ptr_fun<int, int>(isspace))).base(), s.end());
13
14Therefore replace ptr_fun with lambda
15
16Also use 'unsigned char' parameter to std::isspace, for reason see [1]
17
18[1] https://en.cppreference.com/w/cpp/string/byte/isspace#Notes
19
20Upstream-Status: Submitted [https://github.com/Gregwar/fatcat/pull/36]
21Signed-off-by: Khem Raj <raj.khem@gmail.com>
22---
23 src/FatUtils.h | 4 ++--
24 1 file changed, 2 insertions(+), 2 deletions(-)
25
26diff --git a/src/FatUtils.h b/src/FatUtils.h
27index 5080f2a..a8d69ee 100644
28--- a/src/FatUtils.h
29+++ b/src/FatUtils.h
30@@ -32,13 +32,13 @@ using namespace std;
31
32 // trim from start
33 static inline string ltrim(string s) {
34- s.erase(s.begin(), find_if(s.begin(), s.end(), not1(ptr_fun<int, int>(isspace))));
35+ s.erase(s.begin(), find_if(s.begin(), s.end(), [](unsigned char c) {return !isspace(c);}));
36 return s;
37 }
38
39 // trim from end
40 static inline string rtrim(string s) {
41- s.erase(find_if(s.rbegin(), s.rend(), not1(ptr_fun<int, int>(isspace))).base(), s.end());
42+ s.erase(find_if(s.rbegin(), s.rend(), [](unsigned char c) {return !isspace(c);}).base(), s.end());
43 return s;
44 }
45
46--
472.39.0
48
diff --git a/meta-filesystems/recipes-utils/fatcat/fatcat_1.1.1.bb b/meta-filesystems/recipes-utils/fatcat/fatcat_1.1.1.bb
index 982a52d62..214b3f914 100644
--- a/meta-filesystems/recipes-utils/fatcat/fatcat_1.1.1.bb
+++ b/meta-filesystems/recipes-utils/fatcat/fatcat_1.1.1.bb
@@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=57fbbfebd0dd1d6ff21b8cecb552a03f"
10SRC_URI = "git://github.com/Gregwar/fatcat.git;branch=master;protocol=https \ 10SRC_URI = "git://github.com/Gregwar/fatcat.git;branch=master;protocol=https \
11 file://0001-Use-unistd.h-not-argp.h-for-all-POSIX-systems.patch \ 11 file://0001-Use-unistd.h-not-argp.h-for-all-POSIX-systems.patch \
12 file://0002-Enable-64bit-off_t.patch \ 12 file://0002-Enable-64bit-off_t.patch \
13 file://0001-Replace-std-ptr_fun-for-c-17.patch \
13 " 14 "
14 15
15SRCREV = "99cb99fc86eb1601ac7ae27f5bba23add04d2543" 16SRCREV = "99cb99fc86eb1601ac7ae27f5bba23add04d2543"