+ wxASSERT((flags & ~(wxZLIB_ZLIB | wxZLIB_GZIP)) == 0);
+
+ // when autodetecting between gzip & zlib, silently drop gzip flag
+ // if the version of zlib doesn't support it
+ if (flags == (wxZLIB_ZLIB | wxZLIB_GZIP)
+ && strcmp(zlib_version, "1.2.") < 0)
+ flags &= ~wxZLIB_GZIP;
+
+ int bits = flags ? MAX_WBITS : -MAX_WBITS;
+ if (flags & wxZLIB_GZIP)
+ bits |= (flags & wxZLIB_ZLIB) ? 0x20 : 0x10;