]> granicus.if.org Git - php/commitdiff
add definitions for MAX_WBITS in case it isn't defined
authorGreg Beaver <cellog@php.net>
Sat, 12 Jan 2008 16:15:17 +0000 (16:15 +0000)
committerGreg Beaver <cellog@php.net>
Sat, 12 Jan 2008 16:15:17 +0000 (16:15 +0000)
ext/phar/phar.c
ext/phar/tar.c

index be42e2d736222970f64c364442602009bdb763da..74f737d29fefabda5fbd29fa4dc1e0669a9cee70 100644 (file)
@@ -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())) {
index de2eec855762053e01cfb090adc63ad5a5dc8463..d9094eda26e4616b24603a70aac5677d421e66b6 100644 (file)
@@ -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);