From:             [EMAIL PROTECTED]
Operating system: Anything with gd 2.0.3 or later
PHP version:      4.2.3
PHP Bug Type:     Compile Failure
Bug description:  gd 2.0.3 gdIOCtx renames 'free' member to 'gd_free', this breaks PHP 
builds

First let me acknowledge that "bug" is not the right
word for this. No criticism is intended.

Now, here's the situation:

I am the author of the gd library 
(http://www.boutell.com/gd/). PHP uses this library to
generate images. gd 2.0.x has recently been revived,
debugged and promoted as the latest and greatest,
truecolor-capable version, and PHP supports this.
Hurrah. Except...

In gd 2.0.3, a contributor changed the name of the
'free' member of the gdIOCtx structure (in gd_io.h),
with the very best of intentions: he wanted to improve
compatibility with macro-based memory leak detectors,
which were easily confused by a structure member
called 'free'. I did not immediately realize, when
I accepted the patch, that of course it would break
PHP and other code that uses custom gdIOCtx structures.

In gd 2.0.3 and above, the 'free' member of this
structure has been renamed 'gd_free'. By now, this
change is already reflected in GD.pm (for Perl) and
other code, making it hard to back out at this point.
Otherwise, I'd gladly make the change in gd instead.

The corresponding fix to PHP is absolutely trivial and 
straightforward, of course, and I hope that it can be 
quickly included in the next patch of PHP 4.2.x and
4.3.x. 

(Technically, I *have* made the change in gd, but the 
solution there is not optimal and fixing the structure name 
in PHP code makes much more sense: in the forthcoming gd 
2.0.5, there's a way to set a #define that would change the 
member name from gd_free to something else, but this is 
only useful if gd will be used ONLY with the code that 
expects to see something else, and therefore not useful for 
building a pretty shared library of gd, which we all want 
to see. And setting that macro constitutes something new to 
do in PHP; if that's going to happen it makes much more 
sense to just fix the occurrences of .free to .gd_free and 
be done with it!)

My apologies for the annoyance, and I hope we can get this 
fixed soon and make the PHP people who are sending me sad 
"it won't build!" emails about gd 2.0.x happy.

-- 
Edit bug report at http://bugs.php.net/?id=20258&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=20258&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=20258&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=20258&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=20258&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=20258&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=20258&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=20258&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=20258&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=20258&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=20258&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20258&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=20258&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=20258&r=isapi

Reply via email to