Skip to content

Commit

Permalink
Rebase patches to platform-tools-34.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Biswa96 authored and anatol committed Feb 25, 2023
1 parent 0955adf commit 4ebec5b
Show file tree
Hide file tree
Showing 20 changed files with 238 additions and 366 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,16 @@ diff --git a/sysdeps.h b/sysdeps.h
index 5ba85b4d..2115a32b 100644
--- a/sysdeps.h
+++ b/sysdeps.h
@@ -49,11 +49,13 @@ static inline void* mempcpy(void* dst, const void* src, size_t n) {
@@ -49,6 +49,12 @@ static inline void* mempcpy(void* dst, const void* src, size_t n) {
}
#endif

-#ifdef _WIN32
-
// Clang-only nullability specifiers
+// Clang-only nullability specifiers
+#ifndef __clang__
#define _Nonnull
#define _Nullable
+#define _Nonnull
+#define _Nullable
+#endif
+
+#ifdef _WIN32
#ifdef _WIN32

#include <ctype.h>
#include <direct.h>
34 changes: 0 additions & 34 deletions patches/adb/0012-Include-cstring-in-various-file-missing-it.patch

This file was deleted.

23 changes: 0 additions & 23 deletions patches/adb/0014-include-climits-where-necessary-for-INT_MAX.patch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ diff --git a/types.h b/types.h
index be9fb1f6..a5747d05 100644
--- a/types.h
+++ b/types.h
@@ -347,13 +347,13 @@ struct enable_weak_from_this {
@@ -346,13 +346,13 @@ struct enable_weak_from_this {
}
}

- weak_ptr<T> weak() { return weak_ptr<T>(static_cast<T*>(this)); }
+ ::weak_ptr<T> weak() { return ::weak_ptr<T>(static_cast<T*>(this)); }

void schedule_deletion() {
fdevent_run_on_main_thread([this]() { delete static_cast<T*>(this); });
fdevent_run_on_looper([this]() { delete static_cast<T*>(this); });
}

private:
Expand Down
35 changes: 0 additions & 35 deletions patches/adb/0018-pairing_auth-include-cstring-for-memcpy.patch

This file was deleted.

22 changes: 0 additions & 22 deletions patches/adb/0021-fix-build-on-gcc.patch

This file was deleted.

27 changes: 0 additions & 27 deletions patches/adb/0022-tls-include-functional.patch

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ diff --git a/client/usb_linux.cpp b/client/usb_linux.cpp
index 7f926266..235a21be 100644
--- a/client/usb_linux.cpp
+++ b/client/usb_linux.cpp
@@ -71,8 +71,8 @@ struct usb_handle {
unsigned zero_mask;
unsigned writeable = 1;

@@ -76,8 +76,8 @@ struct usb_handle {
// to fill in those values, ignore this warning.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu-variable-sized-type-not-at-end"
- usbdevfs_urb urb_in;
- usbdevfs_urb urb_out;
+ usbdevfs_urb *urb_in;
+ usbdevfs_urb *urb_out;

#pragma clang diagnostic pop

bool urb_in_busy = false;
bool urb_out_busy = false;
@@ -303,7 +303,7 @@ static int usb_bulk_write(usb_handle* h, const void* data, int len) {
std::unique_lock<std::mutex> lock(h->mutex);
D("++ usb_bulk_write ++");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,16 @@ index c7b3eba1451f..44816b279c1a 100644
const auto result = ExecuteBinary({"/bin/date", "--help"});
ASSERT_THAT(result, NotNull());
ASSERT_EQ(result->status, 0);
- ASSERT_EQ(result->stdout_str.find("usage: date "), 0);
+ ASSERT_EQ(result->stdout_.find("usage: date "), 0);
- ASSERT_GE(result->stdout_str.find("usage: date "), 0);
+ ASSERT_GE(result->stdout_.find("usage: date "), 0);
}

TEST(PosixUtilsTest, RelativePathToBinary) {
const auto result = ExecuteBinary({"date", "--help"});
ASSERT_THAT(result, NotNull());
ASSERT_EQ(result->status, 0);
- ASSERT_EQ(result->stdout_str.find("usage: date "), 0);
+ ASSERT_EQ(result->stdout_.find("usage: date "), 0);
- ASSERT_GE(result->stdout_str.find("usage: date "), 0);
+ ASSERT_GE(result->stdout_.find("usage: date "), 0);
}

TEST(PosixUtilsTest, BadParameters) {
Original file line number Diff line number Diff line change
Expand Up @@ -504,13 +504,16 @@ diff --git a/libprocessgroup/include/processgroup/processgroup.h b/libprocessgro
index c5badc941f..8ecc416784 100644
--- a/libprocessgroup/include/processgroup/processgroup.h
+++ b/libprocessgroup/include/processgroup/processgroup.h
@@ -16,12 +16,13 @@
@@ -16,7 +16,6 @@

#pragma once

-#include <sys/cdefs.h>
#include <sys/types.h>
#include <string>
#include <initializer_list>
#include <span>
@@ -24,7 +23,9 @@
#include <string_view>
#include <vector>

-__BEGIN_DECLS
Expand All @@ -520,8 +523,30 @@ index c5badc941f..8ecc416784 100644

static constexpr const char* CGROUPV2_CONTROLLER_NAME = "cgroup2";

@@ -74,4 +75,6 @@ bool getAttributePathForTask(const std::string& attr_name, int tid, std::string*

@@ -37,7 +38,9 @@ bool CgroupGetAttributePathForTask(const std::string& attr_name, int tid, std::s
bool SetTaskProfiles(int tid, const std::vector<std::string>& profiles, bool use_fd_cache = false);
bool SetProcessProfiles(uid_t uid, pid_t pid, const std::vector<std::string>& profiles);

-__END_DECLS
+#ifdef __cplusplus
+}
+#endif

bool SetTaskProfiles(int tid, std::initializer_list<std::string_view> profiles,
bool use_fd_cache = false);
@@ -48,7 +51,9 @@ bool SetTaskProfiles(int tid, std::span<const std::string_view> profiles,
bool SetProcessProfiles(uid_t uid, pid_t pid, std::span<const std::string_view> profiles);
#endif

-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif

#ifndef __ANDROID_VNDK__

@@ -92,4 +97,6 @@ bool getAttributePathForTask(const std::string& attr_name, int tid, std::string*

#endif // __ANDROID_VNDK__

-__END_DECLS
Expand All @@ -538,8 +563,8 @@ index 9ee3781a62..f424483603 100644

-#include <sys/cdefs.h>
#include <sys/types.h>
#include <functional>
#include <map>
#include <mutex>
diff --git a/libsuspend/autosuspend_ops.h b/libsuspend/autosuspend_ops.h
index b0024c8bb2..ea0eafd00e 100644
--- a/libsuspend/autosuspend_ops.h
Expand Down
25 changes: 25 additions & 0 deletions patches/core/0011-core-include-missing-headers.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 31d49215b221e6f7677c1983dc97a05640db3691 Mon Sep 17 00:00:00 2001
From: Biswapriyo Nath <[email protected]>
Date: Sat, 25 Feb 2023 15:13:29 +0530
Subject: [PATCH] core include missing headers

---
fastboot/super_flash_helper.cpp | 2 ++
1 file changed, 2 insertions(+)

diff --git a/fastboot/super_flash_helper.cpp b/fastboot/super_flash_helper.cpp
index b617ce8..647b26f 100644
--- a/fastboot/super_flash_helper.cpp
+++ b/fastboot/super_flash_helper.cpp
@@ -20,6 +20,8 @@

#include "util.h"

+#include <limits.h>
+
using android::base::borrowed_fd;
using android::base::unique_fd;
using android::fs_mgr::SuperImageExtent;
--
2.39.2

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4ebec5b

Please sign in to comment.