From 7ff0648275a752db9ab33c2e1708e475b5831675 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Wed, 25 May 2016 08:54:30 +0100 Subject: Fix for MinGW-w64 Limit the scope of '#pragma pack(2)', otherwise gunzip fails on 64-bit Windows. --- archival/libarchive/decompress_gunzip.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/archival/libarchive/decompress_gunzip.c b/archival/libarchive/decompress_gunzip.c index eb64645ae..94dbd7a95 100644 --- a/archival/libarchive/decompress_gunzip.c +++ b/archival/libarchive/decompress_gunzip.c @@ -36,9 +36,6 @@ #include #include "libbb.h" #include "bb_archive.h" -#if ENABLE_PLATFORM_MINGW32 && __GNUC__ -#pragma pack(2) -#endif typedef struct huft_t { unsigned char e; /* number of extra bits or operation */ @@ -1121,6 +1118,9 @@ static uint32_t buffer_read_le_u32(STATE_PARAM_ONLY) return res; } +#if ENABLE_PLATFORM_MINGW32 && __GNUC__ +#pragma pack(2) +#endif static int check_header_gzip(STATE_PARAM transformer_state_t *xstate) { union { @@ -1192,6 +1192,9 @@ static int check_header_gzip(STATE_PARAM transformer_state_t *xstate) } return 1; } +#if ENABLE_PLATFORM_MINGW32 && __GNUC__ +#pragma pack() +#endif IF_DESKTOP(long long) int FAST_FUNC unpack_gz_stream(transformer_state_t *xstate) -- cgit v1.2.3-55-g6feb