JuliaLang/julia — pull request #1595 by kmsquire (2012-11-22 10:37:16+00:00)
Title: gzip/zlib fixes

This commit fixes issues with accessing closed files from versions of zlib earlier than 1.2.7,

It turns out that zlib 1.2.7 is much more robust/forgiving when accessing closed files, but earlier versions are not, so we explicitly test the closed state before writing.

This is done in macros, so it's probably possible to check the version number and only do the test when the version is less than 1.2.7.

Also, remove the `Zlib` import from `gzip.jl` introduced in 827212810c, as all of the imported constants are available directly from `zlib_h.jl`