This is from a patch that is in the tracker, but it leaves out a fix of BLI_gzopen which needs more work.