> gd.h in the GD library (v 1.8.4) distribution (www.boutell.com/gd) declares
> ...
>
>    typedef struct gdIOCtx { ..blah blah... } gdIOCtx;
>
> Then ext/gd/gd.c also goes ahead and declares ...
>
> #ifdef USE_GD_IOCTX
> ..
> ..
>    typedef struct gdIOCtx;
> ..
> ..
> #endif
>
> Perhaps the guard USE_GD_IOCTX should have been taking effect ...but it
> isnt.
> So the PHP declaration is clearly conflicting.

No, you are not reading the code right.  The actual code says:

#ifdef USE_GD_IOCTX
#include "gd_ctx.c"
#else
#define gdImageCreateFromGdCtx      NULL
#define gdImageCreateFromGd2Ctx     NULL
#define gdImageCreateFromGd2partCtx NULL
#define gdImageCreateFromGifCtx     NULL
#define gdImageCreateFromJpegCtx    NULL
#define gdImageCreateFromPngCtx     NULL
#define gdImageCreateFromWBMPCtx    NULL
typedef FILE gdIOCtx;
#define CTX_PUTC(c, fp) fputc(c, fp)
#endif


Note the #else there.  So the only way that PHP will do that typedef is if
USE_GD_IOCTX is not set.  And this will not be set based on this:

#if HAVE_LIBGD15
/* it's >= 1.5, i.e. has IOCtx */
#define USE_GD_IOCTX 1
#else
#undef USE_GD_IOCTX
#endif

ie. if HAVE_LIBGD15 is set, we set it.  And this symbol comes from this
config.m4 rule:

  PHP_CHECK_LIBRARY(gd, gdImagePaletteCopy,     [AC_DEFINE(HAVE_LIBGD15,             
1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])

That says that it will link against libgd and check for the
gdImagePaletteCopy() function.  If it sees this function in the library,
it will define HAVE_LIBGD15.  My prediction is still that you have
multiple versions of libgd installed.  Probably an old libgd 1.3 library
floating around somewhere that is getting picked up on this configure
link.

"locate libgd" should prove interesting.

-Rasmus


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to