summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2022-02-09 16:36:11 +0100
committerSergei Golubchik <serg@mariadb.org>2022-02-09 19:13:52 +0100
commit9bd7e526e7b82a2dc554e942d41072f47dd471fa (patch)
tree0373f502b7725f8a5cdfaee1923b148005b65556
parent70a8875564799c726960cc644dc6eed7ca499e71 (diff)
downloadmariadb-git-9bd7e526e7b82a2dc554e942d41072f47dd471fa.tar.gz
support lzma < 5.1.3alpha
where `lzma_allocator *allocator` isn't declared const
-rw-r--r--include/providers/lzma.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/providers/lzma.h b/include/providers/lzma.h
index 0ba04ede472..8125bb8cb04 100644
--- a/include/providers/lzma.h
+++ b/include/providers/lzma.h
@@ -52,12 +52,18 @@ typedef enum
#define lzma_stream_buffer_decode(...) provider_service_lzma->lzma_stream_buffer_decode_ptr (__VA_ARGS__)
#define lzma_easy_buffer_encode(...) provider_service_lzma->lzma_easy_buffer_encode_ptr (__VA_ARGS__)
+#elif LZMA_VERSION < 50010030
+#define lzma_maybe_const
+#endif
+
+#ifndef lzma_maybe_const
+#define lzma_maybe_const const
#endif
#define DEFINE_lzma_stream_buffer_decode(NAME) NAME( \
uint64_t *memlimit, \
uint32_t flags, \
- const lzma_allocator *allocator, \
+ lzma_maybe_const lzma_allocator *allocator, \
const uint8_t *in, \
size_t *in_pos, \
size_t in_size, \
@@ -69,7 +75,7 @@ typedef enum
#define DEFINE_lzma_easy_buffer_encode(NAME) NAME( \
uint32_t preset, \
lzma_check check, \
- const lzma_allocator *allocator, \
+ lzma_maybe_const lzma_allocator *allocator, \
const uint8_t *in, \
size_t in_size, \
uint8_t *out, \