Modified for build with zlib 1.2.3.3 or earlier