GNOME Bugzilla – Bug 662826
Mac OS X 10.4 zlib 1.2.3 lacks deflateSetHeader, inflateGetHeader
Last modified: 2018-05-24 13:30:02 UTC
Created attachment 200076 [details] [review] Don't deflateSetHeader/inflateGetHeader on OS versions that lack them gzlibdecompressor.c and gzlibcompressor.c presume that if zlib >=1.2.3 is installed, deflateSetHeader and inflateGetHeader are present. Mac OS X 10.4.x (Tiger) ships with a zlib 1.2.3 build that doesn't export those two symbols, so building glib under OS X 10.4.x fails. 10.6.x (Snow Leopard) ships with a zlib 1.2.3 build that DOES have the symbols. I believe that 10.5.x (Leopard) has the symbols, but I'm not sure. 10.7.x (Snow Leopard) ships with zlib 1.2.5. The existing code that uses deflateSetHeader/inflateGetHeader is presently #if'd so that it becomes a no-op under Windows with zlib <1.2.4. I am attaching a patch that does the same for affected Mac OS X versions. My patch adds a second #if rather than integrating with the existing #if, simply to keep that line from getting too long and ugly. XCode 3.2.6 always defines __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__, but XCode 2.5 only defines it if a deployment target has been explicitly specified. Therefore, my patch defaults to not using deflateSetHeader/inflateGetHeader if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ is not defined, unless the zlib version is >=1.2.5. If the zlib version is >=1.2.5, it uses deflateSetHeader/inflateGetHeader even under Tiger; this allows someone to build against a locally compiled copy of zlib and get the deflateSetHeader/inflateGetHeader functionality.
Comment on attachment 200076 [details] [review] Don't deflateSetHeader/inflateGetHeader on OS versions that lack them it would be better to just add a configure check for those functions rather than trying to figure out specific versions
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/474.