android-tools/android-tools-7.1.1_r13-fix-build.patch

67 lines
1.6 KiB
Diff

diff --git a/core/adb/sysdeps.h b/core/adb/sysdeps.h
index 75dcc86..867f3ec 100644
--- a/core/adb/sysdeps.h
+++ b/core/adb/sysdeps.h
@@ -25,6 +25,7 @@
#endif
#include <errno.h>
+#include <sys/syscall.h>
#include <string>
#include <vector>
@@ -831,7 +832,16 @@ static __inline__ int adb_is_absolute_host_path(const char* path) {
static __inline__ unsigned long adb_thread_id()
{
- return (unsigned long)gettid();
+ // TODO: this function should be merged with GetThreadId
+#if defined(__BIONIC__)
+ return gettid();
+#elif defined(__APPLE__)
+ return syscall(SYS_thread_selfid);
+#elif defined(__linux__)
+ return syscall(__NR_gettid);
+#elif defined(_WIN32)
+ return GetCurrentThreadId();
+#endif
}
#endif /* !_WIN32 */
diff --git a/core/base/errors_unix.cpp b/core/base/errors_unix.cpp
index 296995e..48269b6 100644
--- a/core/base/errors_unix.cpp
+++ b/core/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/core/base/file.cpp b/core/base/file.cpp
index da1adba..91a3901 100644
--- a/core/base/file.cpp
+++ b/core/base/file.cpp
@@ -20,6 +20,7 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <string.h>
#include <string>
diff --git a/core/base/logging.cpp b/core/base/logging.cpp
index 1741871..e97c7f1 100644
--- a/core/base/logging.cpp
+++ b/core/base/logging.cpp
@@ -21,6 +21,7 @@
#include "android-base/logging.h"
#include <libgen.h>
+#include <string.h>
// For getprogname(3) or program_invocation_short_name.
#if defined(__ANDROID__) || defined(__APPLE__)