+ // see zlib.h for documentation on windowBits
+ int windowBits = MAX_WBITS;
+ switch (flags) {
+ case wxZLIB_NO_HEADER: windowBits = -MAX_WBITS; break;
+ case wxZLIB_ZLIB: windowBits = MAX_WBITS; break;
+ case wxZLIB_GZIP: windowBits = MAX_WBITS | ZSTREAM_GZIP; break;
+ case wxZLIB_AUTO: windowBits = MAX_WBITS | ZSTREAM_AUTO; break;
+ default: wxFAIL_MSG(wxT("Invalid zlib flag"));
+ }
+
+ if (inflateInit2(m_inflate, windowBits) == Z_OK)
+ return;
+ }
+ }
+
+ wxLogError(_("Can't initialize zlib inflate stream."));
+ m_lasterror = wxSTREAM_READ_ERROR;