Skip to content

Commit

Permalink
Remove unnecessary HAVE_LZMA_FILTER_ARM64 feature check (libarchive#2433
Browse files Browse the repository at this point in the history
)

It is sufficent to use HAVE_LZMA_H and then check for macros defined in
lzma.h
  • Loading branch information
mostynb authored Dec 11, 2024
1 parent 8291210 commit 6516cd1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
13 changes: 0 additions & 13 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -518,19 +518,6 @@ if test "x$with_lzma" != "xno"; then
if test "x$ac_cv_lzma_has_mt" != xno; then
AC_DEFINE([HAVE_LZMA_STREAM_ENCODER_MT], [1], [Define to 1 if you have the `lzma_stream_encoder_mt' function.])
fi

AC_CACHE_CHECK(
[whether we have ARM64 filter support in lzma],
ac_cv_lzma_has_arm64,
[AC_LINK_IFELSE([
AC_LANG_PROGRAM([[#include <lzma.h>]
[#ifndef LZMA_FILTER_ARM64]
[#error unsupported]
[#endif]])],
[ac_cv_lzma_has_arm64=yes], [ac_cv_lzma_has_arm64=no])])
if test "x$ac_cv_lzma_has_arm64" != xno; then
AC_DEFINE([HAVE_LZMA_FILTER_ARM64], [1], [Define to 1 if you have the `LZMA_FILTER_ARM64' macro.])
fi
fi

AC_ARG_WITH([lzo2],
Expand Down
6 changes: 5 additions & 1 deletion libarchive/test/test_read_format_7zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
*/
#include "test.h"

#if HAVE_LZMA_H
#include <lzma.h>
#endif

#if defined(_WIN32) && !defined(__CYGWIN__)
#define close _close
#define open _open
Expand Down Expand Up @@ -1158,7 +1162,7 @@ test_arm64_filter(const char *refname)

DEFINE_TEST(test_read_format_7zip_lzma2_arm64)
{
#ifdef HAVE_LZMA_FILTER_ARM64
#ifdef LZMA_FILTER_ARM64
struct archive *a;

assert((a = archive_read_new()) != NULL);
Expand Down

0 comments on commit 6516cd1

Please sign in to comment.