From 9bcbbce5bf9e82e1953fcf091b768eed36451c22 Mon Sep 17 00:00:00 2001 From: Greg Beaver Date: Sat, 12 Jan 2008 16:15:17 +0000 Subject: [PATCH] add definitions for MAX_WBITS in case it isn't defined --- ext/phar/phar.c | 4 ++++ ext/phar/tar.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index be42e2d736..74f737d29f 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1672,6 +1672,10 @@ static int phar_open_fp(php_stream* fp, char *fname, int fname_len, char *alias, MAPPHAR_ALLOC_FAIL("unable to decompress gzipped phar archive \"%s\" to temporary file, enable zlib extension in php.ini") } array_init(&filterparams); +/* this is defined in zlib's zconf.h */ +#ifndef MAX_WBITS +#define MAX_WBITS 15 +#endif add_assoc_long(&filterparams, "window", MAX_WBITS + 32); /* entire file is gzip-compressed, uncompress to temporary file */ if (!(temp = php_stream_fopen_tmpfile())) { diff --git a/ext/phar/tar.c b/ext/phar/tar.c index de2eec8557..d9094eda26 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -571,6 +571,10 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, long len, char **er zval filterparams; array_init(&filterparams); +/* this is defined in zlib's zconf.h */ +#ifndef MAX_WBITS +#define MAX_WBITS 15 +#endif add_assoc_long(&filterparams, "window", MAX_WBITS + 16); filter = php_stream_filter_create("zlib.deflate", &filterparams, php_stream_is_persistent(phar->fp) TSRMLS_CC); zval_dtor(&filterparams); -- 2.50.1