After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 662826 - Mac OS X 10.4 zlib 1.2.3 lacks deflateSetHeader, inflateGetHeader
Mac OS X 10.4 zlib 1.2.3 lacks deflateSetHeader, inflateGetHeader
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gio
2.27.x
Other Mac OS
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-10-27 05:10 UTC by Adam Goldman
Modified: 2018-05-24 13:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't deflateSetHeader/inflateGetHeader on OS versions that lack them (2.15 KB, patch)
2011-10-27 05:10 UTC, Adam Goldman
needs-work Details | Review

Description Adam Goldman 2011-10-27 05:10:52 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 1 Dan Winship 2011-10-27 12:20:17 UTC
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
Comment 2 GNOME Infrastructure Team 2018-05-24 13:30:02 UTC
-- 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.