Bug 5521 - building against Gentoo-patched zlib fails due to use of OF() macro
Status: RESOLVED INVALID
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Platform
Version: GIT MASTER
Hardware: All All
: P3 minor
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2012-05-28 12:50 EDT by symlink
Modified: 2012-07-01 13:04:12 EDT
2 users (show)

See Also:



Description symlink 2012-05-28 12:50:18 EDT
When building with something like "USE_LOCAL_HEADERS=0 USE_INTERNAL_ZLIB=0 make", compilation fails.
The "OF()" macro used in several places in ioquake3 has been renamed to "_Z_OF()" in newer zlib versions >=1.2.5 (see zconf.h).

I don't have a patch ready, as there are basically two ways;
- #ifdef the macro usage only
- update the OF() usage and the zlib copy in ioquake3/code/zlib/
Comment 1 symlink 2012-05-28 13:07:19 EDT
Meh, seems like I was a little too quick on this. The renamed macro is currently Gentoo-specific, see https://bugs.gentoo.org/show_bug.cgi?id=383179
Comment 2 Simon McVittie 2012-05-29 06:52:06 EDT
It sounds as though OF() is meant to be private to zlib itself (i.e. not public API), but is used by unzip.[ch] and ioapi.[ch] anyway.

The easiest solution is probably to expand OF() to its ISO C definition (replace OF((foo)) with (foo)) throughout code/qcommon. ioquake3 uses ISO C prototypes elsewhere anyway, so it won't (and shouldn't!) compile on ancient K&R C compilers.
Comment 3 Thilo Schulz 2012-07-01 13:04:12 EDT
Well, I don't feel like messing with zlib code or anything in this direction.