diff options
Diffstat (limited to 'archival')
-rw-r--r-- | archival/libarchive/decompress_unxz.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/archival/libarchive/decompress_unxz.c b/archival/libarchive/decompress_unxz.c index cd32cc745..350e5358a 100644 --- a/archival/libarchive/decompress_unxz.c +++ b/archival/libarchive/decompress_unxz.c | |||
@@ -27,11 +27,17 @@ static uint32_t xz_crc32(const uint8_t *buf, size_t size, uint32_t crc) | |||
27 | return ~crc32_block_endian0(~crc, buf, size, global_crc32_table); | 27 | return ~crc32_block_endian0(~crc, buf, size, global_crc32_table); |
28 | } | 28 | } |
29 | 29 | ||
30 | /* We use arch-optimized unaligned accessors */ | 30 | /* We use arch-optimized unaligned fixed-endian accessors. |
31 | #define get_unaligned_le32(buf) ({ uint32_t v; move_from_unaligned32(v, buf); SWAP_LE32(v); }) | 31 | * They have been moved to libbb (proved to be useful elsewhere as well), |
32 | #define get_unaligned_be32(buf) ({ uint32_t v; move_from_unaligned32(v, buf); SWAP_BE32(v); }) | 32 | * just check that we have them defined: |
33 | #define put_unaligned_le32(val, buf) move_to_unaligned32(buf, SWAP_LE32(val)) | 33 | */ |
34 | #define put_unaligned_be32(val, buf) move_to_unaligned32(buf, SWAP_BE32(val)) | 34 | #if !defined(get_unaligned_le32) \ |
35 | || !defined(get_unaligned_be32) \ | ||
36 | || !defined(put_unaligned_le32) \ | ||
37 | || !defined(put_unaligned_be32) | ||
38 | # error get_unaligned_le32 accessors are not defined | ||
39 | #endif | ||
40 | #define get_le32(p) (*(uint32_t*)(p)) | ||
35 | 41 | ||
36 | #include "unxz/xz_dec_bcj.c" | 42 | #include "unxz/xz_dec_bcj.c" |
37 | #include "unxz/xz_dec_lzma2.c" | 43 | #include "unxz/xz_dec_lzma2.c" |