Fix building with newer zlib versions
Support building with Qt5