#include "archive_private.h"
#include "archive_read_private.h"
-#if HAVE_BZLIB_H
+#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
struct private_data {
bz_stream stream;
char *out_block;
reader->init = bzip2_reader_init;
reader->options = NULL;
reader->free = bzip2_reader_free;
-#if HAVE_BZLIB_H
+#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
return (ARCHIVE_OK);
#else
archive_set_error(_a, ARCHIVE_ERRNO_MISC,
return (bits_checked);
}
-#ifndef HAVE_BZLIB_H
+#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR)
/*
* If we don't have the library on this system, we can't actually do the
return (ret);
}
-#endif /* HAVE_BZLIB_H */
+#endif /* HAVE_BZLIB_H && BZ_CONFIG_ERROR */
enum enctype rd_encoding;
z_stream stream;
int stream_valid;
-#ifdef HAVE_BZLIB_H
+#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
bz_stream bzstream;
int bzstream_valid;
#endif
xar->stream.total_in = 0;
xar->stream.total_out = 0;
break;
-#ifdef HAVE_BZLIB_H
+#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
case BZIP2:
if (xar->bzstream_valid) {
BZ2_bzDecompressEnd(&(xar->bzstream));
* Unsupported compression.
*/
default:
-#ifndef HAVE_BZLIB_H
+#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR)
case BZIP2:
#endif
#if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA)
*used = avail_in - xar->stream.avail_in;
*outbytes = avail_out - xar->stream.avail_out;
break;
-#ifdef HAVE_BZLIB_H
+#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
case BZIP2:
xar->bzstream.next_in = (char *)(uintptr_t)b;
xar->bzstream.avail_in = avail_in;
*outbytes = avail_out - xar->lzstream.avail_out;
break;
#endif
-#ifndef HAVE_BZLIB_H
+#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR)
case BZIP2:
#endif
#if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA)
r = ARCHIVE_FATAL;
}
}
-#ifdef HAVE_BZLIB_H
+#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
if (xar->bzstream_valid) {
if (BZ2_bzDecompressEnd(&(xar->bzstream)) != BZ_OK) {
archive_set_error(&a->archive,
#include "archive_private.h"
#include "archive_write_private.h"
-#ifndef HAVE_BZLIB_H
+#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR)
int
archive_write_set_compression_bzip2(struct archive *a)
{
}
}
-#endif /* HAVE_BZLIB_H */
+#endif /* HAVE_BZLIB_H && BZ_CONFIG_ERROR */