Merge r340 from libarchive.googlecode.com: If zlib/bzlib aren't available,

we can still detect gzip/bzip2 compressed streams, we just can't
decompress them.
This commit is contained in:
Tim Kientzle 2009-03-03 17:07:27 +00:00
parent 690f818afd
commit 9c886c4181
2 changed files with 20 additions and 6 deletions

View File

@ -25,9 +25,6 @@
#include "archive_platform.h"
/* Don't compile this if we don't have bzlib. */
#if HAVE_BZLIB_H
__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
@ -48,6 +45,16 @@ __FBSDID("$FreeBSD$");
#include "archive_private.h"
#include "archive_write_private.h"
#ifndef HAVE_BZLIB_H
int
archive_write_set_compression_bzip2(struct archive *_a)
{
/* Unsupported bzip2 compression, we don't have bzlib */
return (ARCHIVE_FATAL);
}
#else
/* Don't compile this if we don't have bzlib. */
struct private_data {
bz_stream stream;
int64_t total_in;

View File

@ -25,9 +25,6 @@
#include "archive_platform.h"
/* Don't compile this if we don't have zlib. */
#if HAVE_ZLIB_H
__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
@ -48,6 +45,16 @@ __FBSDID("$FreeBSD$");
#include "archive_private.h"
#include "archive_write_private.h"
#ifndef HAVE_ZLIB_H
int
archive_write_set_compression_gzip(struct archive *_a)
{
/* Unsupported gzip compression, we don't have zlib */
return (ARCHIVE_FATAL);
}
#else
/* Don't compile this if we don't have zlib. */
struct private_data {
z_stream stream;
int64_t total_in;