ports/devel/android-tools/files/patch-vendor_adb_compression__utils.h
Neel Chauhan 70cd49992b devel/android-tools: New port: Android debugging tools
While I'm here, remove the old devel/android-tools-adb and
devel/android-tools-fastboot ports. These ports are long out-of-date
and the adb port especially had issues with certain devices.

This port was tested from a FreeBSD 14.0 system to flash both
LineageOS and GrapheneOS on a Google Pixel 3 using both `adb` and
`fastboot`.
2022-06-09 15:45:02 -07:00

28 lines
1.1 KiB
C++

--- vendor/adb/compression_utils.h.orig 2022-06-09 20:52:06 UTC
+++ vendor/adb/compression_utils.h
@@ -95,7 +95,12 @@ struct NullDecoder final : public Decoder {
void* p = output_buffer_.data();
while (available_out > 0 && !input_buffer_.empty()) {
size_t len = std::min(available_out, input_buffer_.front_size());
+#ifdef __FreeBSD__
+ // TODO: Delete when FreeBSD 12.x goes EOL
+ p = (char *)memcpy(p, input_buffer_.front_data(), len) + len;
+#else
p = mempcpy(p, input_buffer_.front_data(), len);
+#endif
available_out -= len;
input_buffer_.drop_front(len);
}
@@ -119,7 +124,12 @@ struct NullEncoder final : public Encoder {
while (available_out > 0 && !input_buffer_.empty()) {
size_t len = std::min(available_out, input_buffer_.front_size());
+#ifdef __FreeBSD__
+ // TODO: Delete when FreeBSD 12.x goes EOL
+ p = (char *)memcpy(p, input_buffer_.front_data(), len) + len;
+#else
p = mempcpy(p, input_buffer_.front_data(), len);
+#endif
available_out -= len;
input_buffer_.drop_front(len);
}