blob: b5b74ba7d8d78ee755a723337650e17faf46ae8d [file] [log] [blame]
diff --git a/src/libunwindstack/ElfInterface.cpp b/src/libunwindstack/ElfInterface.cpp
index 821e042..e2cac45 100644
--- a/src/libunwindstack/ElfInterface.cpp
+++ b/src/libunwindstack/ElfInterface.cpp
@@ -22,6 +22,7 @@
#include <utility>
#include <7zCrc.h>
+#include <7zVersion.h>
#include <Xz.h>
#include <XzCrc64.h>
@@ -39,6 +40,12 @@
namespace unwindstack {
+#if MY_VER_MAJOR < 17
+namespace {
+typedef void* ISzAllocPtr;
+} // namespace
+#endif
+
ElfInterface::~ElfInterface() {
for (auto symbol : symbols_) {
delete symbol;
@@ -128,8 +135,13 @@ Memory* ElfInterface::CreateGnuDebugdataMemory() {
}
dst_remaining += buffer_increment;
}
+#if MY_VER_MAJOR < 18 || (MY_VER_MAJOR == 18 && MY_VER_MINOR < 3)
+ return_val = XzUnpacker_Code(&state, dst->GetPtr(dst_offset), &dst_remaining, &src[src_offset],
+ &src_remaining, CODER_FINISH_ANY, &status);
+#else
return_val = XzUnpacker_Code(&state, dst->GetPtr(dst_offset), &dst_remaining, &src[src_offset],
&src_remaining, true, CODER_FINISH_ANY, &status);
+#endif
src_offset += src_remaining;
dst_offset += dst_remaining;
} while (return_val == SZ_OK && status == CODER_STATUS_NOT_FINISHED);