Fix the Windows adb build.
It looks like we can't use clang on Windows yet because libc++ isn't ready.
So move back to GCC for the Windows host clang. Work around the mingw
printf format string problems that made us want to switch to clang in the
first place, and #include "sysdeps.h" in adb_utils.cpp to work around the
absence of lstat(2) on Windows.
Change-Id: Icd0797a8c0c2d1d326bdd704ba6bcafcbaeb742f
diff --git a/adb/commandline.cpp b/adb/commandline.cpp
index 2d41050..f193d2f 100644
--- a/adb/commandline.cpp
+++ b/adb/commandline.cpp
@@ -1735,7 +1735,11 @@
return 1;
}
+#if defined(_WIN32) // Remove when we're using clang for Win32.
+ std::string cmd = android::base::StringPrintf("exec:pm install-create -S %u", (unsigned) total_size);
+#else
std::string cmd = android::base::StringPrintf("exec:pm install-create -S %" PRIu64, total_size);
+#endif
for (i = 1; i < first_apk; i++) {
cmd += " " + escape_arg(argv[i]);
}
@@ -1775,9 +1779,15 @@
goto finalize_session;
}
+#if defined(_WIN32) // Remove when we're using clang for Win32.
+ std::string cmd = android::base::StringPrintf(
+ "exec:pm install-write -S %u %d %d_%s -",
+ (unsigned) sb.st_size, session_id, i, get_basename(file));
+#else
std::string cmd = android::base::StringPrintf(
"exec:pm install-write -S %" PRIu64 " %d %d_%s -",
static_cast<uint64_t>(sb.st_size), session_id, i, get_basename(file));
+#endif
int localFd = adb_open(file, O_RDONLY);
if (localFd < 0) {