diff --git a/configure.ac b/configure.ac index b49fbc5..b51e1e1 100644 --- a/configure.ac +++ b/configure.ac @@ -83,6 +83,7 @@ AM_CONDITIONAL([STATIC], [test "x$static" = "xyes"]) AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/mman.h) AC_CHECK_HEADERS(ctype.h errno.h sys/resource.h) AC_CHECK_HEADERS(endian.h sys/endian.h arpa/inet.h) +AC_CHECK_HEADERS(alloca.h) AC_TYPE_OFF_T AC_TYPE_SIZE_T diff --git a/lrzip_private.h b/lrzip_private.h index 7eae476..716577e 100644 --- a/lrzip_private.h +++ b/lrzip_private.h @@ -20,6 +20,8 @@ #ifndef LRZIP_PRIV_H #define LRZIP_PRIV_H +#include "config.h" + #define NUM_STREAMS 2 #define STREAM_BUFSIZE (1024 * 1024 * 10) @@ -117,6 +119,7 @@ extern int errno; #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) +#define __maybe_unused __attribute__((unused)) typedef long long int i64; typedef uint32_t u32; diff --git a/lzma/C/LzFindMt.c b/lzma/C/LzFindMt.c index aa41ed9..fa91234 100644 --- a/lzma/C/LzFindMt.c +++ b/lzma/C/LzFindMt.c @@ -5,6 +5,8 @@ #include "LzFindMt.h" +#include "lrzip.h" + void MtSync_Construct(CMtSync *p) { p->wasCreated = False; @@ -454,7 +456,7 @@ void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAlloc *alloc) static unsigned MY_STD_CALL HashThreadFunc2(void *p) { HashThreadFunc((CMatchFinderMt *)p); return 0; } static unsigned MY_STD_CALL BtThreadFunc2(void *p) { - Byte allocaDummy[0x180]; + __maybe_unused Byte allocaDummy[0x180]; int i = 0; for (i = 0; i < 16; i++) allocaDummy[i] = (Byte)i; diff --git a/lzma/C/LzmaEnc.c b/lzma/C/LzmaEnc.c index cf13138..efd46c0 100644 --- a/lzma/C/LzmaEnc.c +++ b/lzma/C/LzmaEnc.c @@ -17,6 +17,8 @@ #include "LzFindMt.h" #endif +#include "lrzip.h" + #ifdef SHOW_STAT static int ttt = 0; #endif @@ -2156,7 +2158,7 @@ static SRes LzmaEnc_Encode2(CLzmaEnc *p, ICompressProgress *progress) SRes res = SZ_OK; #ifndef _7ZIP_ST - Byte allocaDummy[0x300]; + __maybe_unused Byte allocaDummy[0x300]; int i = 0; for (i = 0; i < 16; i++) allocaDummy[i] = (Byte)i;