From: Greg Beaver Date: Sat, 12 Jan 2008 16:15:17 +0000 (+0000) Subject: add definitions for MAX_WBITS in case it isn't defined X-Git-Tag: RELEASE_2_0_0a1~935 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9bcbbce5bf9e82e1953fcf091b768eed36451c22;p=php add definitions for MAX_WBITS in case it isn't defined --- 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);