summarylogtreecommitdiffstats
path: root/fix_build_core.patch
blob: a6feb6ad958ad96c67b3f5b26b577323700a2f36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
diff --git a/adb/adb.cpp b/adb/adb.cpp
index 06e4c50859..2909c3c884 100644
--- a/adb/adb.cpp
+++ b/adb/adb.cpp
@@ -44,8 +44,6 @@
 #include <android-base/parsenetaddress.h>
 #include <android-base/stringprintf.h>
 #include <android-base/strings.h>
-#include <build/version.h>
-#include <platform_tools_version.h>
 
 #include "adb_auth.h"
 #include "adb_io.h"
@@ -66,10 +64,10 @@ std::string adb_version() {
     // Don't change the format of this --- it's parsed by ddmlib.
     return android::base::StringPrintf(
         "Android Debug Bridge version %d.%d.%d\n"
-        "Version %s-%s\n"
+        "Version %s\n"
         "Installed as %s\n",
         ADB_VERSION_MAJOR, ADB_VERSION_MINOR, ADB_SERVER_VERSION,
-        PLATFORM_TOOLS_VERSION, android::build::GetBuildNumber().c_str(),
+        PLATFORM_TOOLS_VERSION,
         android::base::GetExecutablePath().c_str());
 }
 
diff --git a/adb/client/usb_libusb.cpp b/adb/client/usb_libusb.cpp
index f2ca63ba3c..95b27c998b 100644
--- a/adb/client/usb_libusb.cpp
+++ b/adb/client/usb_libusb.cpp
@@ -22,6 +22,7 @@
 #include <stdlib.h>
 
 #include <atomic>
+#include <condition_variable>
 #include <chrono>
 #include <condition_variable>
 #include <memory>
@@ -30,7 +31,7 @@
 #include <thread>
 #include <unordered_map>
 
-#include <libusb/libusb.h>
+#include <libusb-1.0/libusb.h>
 
 #include <android-base/file.h>
 #include <android-base/logging.h>
diff --git a/adb/sysdeps/posix/network.cpp b/adb/sysdeps/posix/network.cpp
index 33ddb4e816..e604a759e2 100644
--- a/adb/sysdeps/posix/network.cpp
+++ b/adb/sysdeps/posix/network.cpp
@@ -16,6 +16,7 @@
 
 #include "sysdeps/network.h"
 
+#include <cstring>
 #include <errno.h>
 #include <netdb.h>
 #include <netinet/in.h>
diff --git a/adb/types.h b/adb/types.h
index 0090c98782..6920af4d6a 100644
--- a/adb/types.h
+++ b/adb/types.h
@@ -22,6 +22,7 @@
 #include <type_traits>
 #include <utility>
 #include <vector>
+#include <cstring>
 
 #include <android-base/logging.h>
 
diff --git a/base/errors_unix.cpp b/base/errors_unix.cpp
index 296995efe2..48269b6750 100644
--- a/base/errors_unix.cpp
+++ b/base/errors_unix.cpp
@@ -17,6 +17,7 @@
 #include "android-base/errors.h"
 
 #include <errno.h>
+#include <string.h>
 
 namespace android {
 namespace base {
diff --git a/base/file.cpp b/base/file.cpp
index 2f4a517589..9049216913 100644
--- a/base/file.cpp
+++ b/base/file.cpp
@@ -26,6 +26,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include <string.h>
 
 #include <memory>
 #include <mutex>
diff --git a/base/logging.cpp b/base/logging.cpp
index f89168c0fc..da522019dc 100644
--- a/base/logging.cpp
+++ b/base/logging.cpp
@@ -24,6 +24,7 @@
 #include <inttypes.h>
 #include <libgen.h>
 #include <time.h>
+#include <string.h>
 
 // For getprogname(3) or program_invocation_short_name.
 #if defined(__ANDROID__) || defined(__APPLE__)
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index d753f0f822..a8987d3024 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -58,9 +58,7 @@
 #include <android-base/stringprintf.h>
 #include <android-base/strings.h>
 #include <android-base/unique_fd.h>
-#include <build/version.h>
 #include <liblp/liblp.h>
-#include <platform_tools_version.h>
 #include <sparse/sparse.h>
 #include <ziparchive/zip_archive.h>
 
@@ -1655,7 +1653,7 @@ int FastBootTool::Main(int argc, char* argv[]) {
                 setvbuf(stdout, nullptr, _IONBF, 0);
                 setvbuf(stderr, nullptr, _IONBF, 0);
             } else if (name == "version") {
-                fprintf(stdout, "fastboot version %s-%s\n", PLATFORM_TOOLS_VERSION, android::build::GetBuildNumber().c_str());
+                fprintf(stdout, "fastboot version %s\n", PLATFORM_TOOLS_VERSION);
                 fprintf(stdout, "Installed as %s\n", android::base::GetExecutablePath().c_str());
                 return 0;
 #if !defined(_WIN32)
diff --git a/fs_mgr/liblp/reader.cpp b/fs_mgr/liblp/reader.cpp
index dcee6d2d86..df7c26d8be 100644
--- a/fs_mgr/liblp/reader.cpp
+++ b/fs_mgr/liblp/reader.cpp
@@ -21,6 +21,7 @@
 #include <unistd.h>
 
 #include <functional>
+#include <cstring>
 
 #include <android-base/file.h>
 #include <android-base/unique_fd.h>
diff --git a/fs_mgr/liblp/writer.cpp b/fs_mgr/liblp/writer.cpp
index bffcb7e6e1..66f447df96 100644
--- a/fs_mgr/liblp/writer.cpp
+++ b/fs_mgr/liblp/writer.cpp
@@ -20,6 +20,7 @@
 #include <unistd.h>
 
 #include <string>
+#include <cstring>
 
 #include <android-base/file.h>
 #include <android-base/unique_fd.h>
@@ -32,7 +33,7 @@ namespace fs_mgr {
 
 std::string SerializeGeometry(const LpMetadataGeometry& input) {
     LpMetadataGeometry geometry = input;
-    memset(geometry.checksum, 0, sizeof(geometry.checksum));
+    std::memset(geometry.checksum, 0, sizeof(geometry.checksum));
     SHA256(&geometry, sizeof(geometry), geometry.checksum);
 
     std::string blob(reinterpret_cast<const char*>(&geometry), sizeof(geometry));
@@ -72,7 +73,7 @@ std::string SerializeMetadata(const LpMetadata& input) {
     SHA256(tables.data(), tables.size(), header.tables_checksum);
 
     // Compute header checksum.
-    memset(header.header_checksum, 0, sizeof(header.header_checksum));
+    std::memset(header.header_checksum, 0, sizeof(header.header_checksum));
     SHA256(&header, sizeof(header), header.header_checksum);
 
     std::string header_blob =
diff --git a/liblog/logger_write.cpp b/liblog/logger_write.cpp
index af8cb2d24a..8ae3257acd 100644
--- a/liblog/logger_write.cpp
+++ b/liblog/logger_write.cpp
@@ -15,7 +15,7 @@
  */
 
 #include <errno.h>
-#include <stdatomic.h>
+#include <atomic> /* https://reviews.llvm.org/D45470 */
 #include <stdlib.h>
 #include <string.h>
 #include <sys/time.h>