Skip to content

Commit b907424

Browse files
authored
fix: basic_string inline templates patch (#9)
2 parents a2d190f + 93324ca commit b907424

File tree

3 files changed

+59
-14
lines changed

3 files changed

+59
-14
lines changed

build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ git apply patches/libpng.patch --whitespace=fix
3535
git apply patches/selinux.patch --whitespace=fix
3636
git apply patches/protobuf.patch --whitespace=fix
3737
git apply patches/aapt2.patch --whitespace=fix
38+
git apply patches/androidfw.patch --whitespace=fix
3839
git apply patches/boringssl.patch --whitespace=fix
3940

4041
# Define all the compilers, libraries and targets.
@@ -97,4 +98,4 @@ ninja || exit 1
9798
mkdir -p "$bin_directory"
9899

99100
# Move aapt2 to bin directory.
100-
mv "$aapt_binary_path" "$bin_directory"
101+
mv "$aapt_binary_path" "$bin_directory"

patches/aapt2.patch

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
11
Submodule src/base contains modified content
2-
diff --git a/src/base/libs/androidfw/ResourceTypes.cpp b/src/base/libs/androidfw/ResourceTypes.cpp
3-
index cae2d0bc16b3..13c5f8fc84e8 100644
4-
--- a/src/base/libs/androidfw/ResourceTypes.cpp
5-
+++ b/src/base/libs/androidfw/ResourceTypes.cpp
6-
@@ -43,7 +43,7 @@
7-
#include <utils/String16.h>
8-
#include <utils/String8.h>
9-
10-
-#ifdef __ANDROID__
11-
+#if 0
12-
#include <binder/TextOutput.h>
13-
14-
#endif
152
diff --git a/src/base/tools/aapt2/ResourceTable.cpp b/src/base/tools/aapt2/ResourceTable.cpp
163
index 8ab1493c6ab3..3a855f0f6866 100644
174
--- a/src/base/tools/aapt2/ResourceTable.cpp

patches/androidfw.patch

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
Submodule src/base contains modified content
2+
diff --git a/src/base/libs/androidfw/ResourceTypes.cpp b/src/base/libs/androidfw/ResourceTypes.cpp
3+
index cae2d0bc16b3..13c5f8fc84e8 100644
4+
--- a/src/base/libs/androidfw/ResourceTypes.cpp
5+
+++ b/src/base/libs/androidfw/ResourceTypes.cpp
6+
@@ -43,7 +43,7 @@
7+
#include <utils/String16.h>
8+
#include <utils/String8.h>
9+
10+
-#ifdef __ANDROID__
11+
+#if 0
12+
#include <binder/TextOutput.h>
13+
14+
#endif
15+
diff --git a/src/base/libs/androidfw/include/androidfw/StringPiece.h b/src/base/libs/androidfw/include/androidfw/StringPiece.h
16+
index 921877dc4982..27e27e1c2b94 100644
17+
--- a/src/base/libs/androidfw/include/androidfw/StringPiece.h
18+
+++ b/src/base/libs/androidfw/include/androidfw/StringPiece.h
19+
@@ -75,6 +75,11 @@ class BasicStringPiece {
20+
bool operator>(const BasicStringPiece<TChar>& rhs) const;
21+
bool operator==(const BasicStringPiece<TChar>& rhs) const;
22+
bool operator!=(const BasicStringPiece<TChar>& rhs) const;
23+
+ // for std::basic_string
24+
+ bool operator<(const std::basic_string<TChar>& rhs) const;
25+
+ bool operator>(const std::basic_string<TChar>& rhs) const;
26+
+ bool operator==(const std::basic_string<TChar>& rhs) const;
27+
+ bool operator!=(const std::basic_string<TChar>& rhs) const;
28+
29+
const_iterator begin() const;
30+
const_iterator end() const;
31+
@@ -256,6 +261,26 @@ inline bool BasicStringPiece<TChar>::operator!=(const BasicStringPiece<TChar>& r
32+
return compare(rhs) != 0;
33+
}
34+
35+
+template <typename TChar>
36+
+inline bool BasicStringPiece<TChar>::operator<(const std::basic_string<TChar>& rhs) const {
37+
+ return compare(BasicStringPiece(rhs)) < 0;
38+
+}
39+
+
40+
+template <typename TChar>
41+
+inline bool BasicStringPiece<TChar>::operator>(const std::basic_string<TChar>& rhs) const {
42+
+ return compare(BasicStringPiece(rhs)) > 0;
43+
+}
44+
+
45+
+template <typename TChar>
46+
+inline bool BasicStringPiece<TChar>::operator==(const std::basic_string<TChar>& rhs) const {
47+
+ return compare(BasicStringPiece(rhs)) == 0;
48+
+}
49+
+
50+
+template <typename TChar>
51+
+inline bool BasicStringPiece<TChar>::operator!=(const std::basic_string<TChar>& rhs) const{
52+
+ return compare(BasicStringPiece(rhs)) != 0;
53+
+}
54+
+
55+
template <typename TChar>
56+
inline typename BasicStringPiece<TChar>::const_iterator BasicStringPiece<TChar>::begin() const {
57+
return data_;

0 commit comments

Comments
 (0)