iliaa           Tue Oct 29 20:05:17 2002 EDT

  Modified files:              
    /php4/ext/gd        config.m4 gd.c gd_ctx.c 
  Log:
  This patch allows compilation of gd against non-bundled gd library older 
  then 2.0.4.
  
  
Index: php4/ext/gd/config.m4
diff -u php4/ext/gd/config.m4:1.119 php4/ext/gd/config.m4:1.120
--- php4/ext/gd/config.m4:1.119 Mon Oct 21 19:41:55 2002
+++ php4/ext/gd/config.m4       Tue Oct 29 20:05:15 2002
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.119 2002/10/21 23:41:55 sniper Exp $
+dnl $Id: config.m4,v 1.120 2002/10/30 01:05:15 iliaa Exp $
 dnl
 
 dnl
@@ -231,6 +231,7 @@
   PHP_CHECK_LIBRARY(gd, gdImageCreateFromXpm,   [AC_DEFINE(HAVE_GD_XPM,              
1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
   PHP_CHECK_LIBRARY(gd, gdImageCreateFromGd2,   [AC_DEFINE(HAVE_GD_GD2,              
1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
   PHP_CHECK_LIBRARY(gd, gdImageCreateTrueColor, [AC_DEFINE(HAVE_LIBGD20,             
1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
+  PHP_CHECK_LIBRARY(gd, gdFreeFontCache,       [AC_DEFINE(HAVE_LIBGD204,            
+1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
   PHP_CHECK_LIBRARY(gd, gdImageSetTile,         [AC_DEFINE(HAVE_GD_IMAGESETTILE,     
1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
   PHP_CHECK_LIBRARY(gd, gdImageEllipse,         [AC_DEFINE(HAVE_GD_IMAGEELLIPSE,     
1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
   PHP_CHECK_LIBRARY(gd, gdImageSetBrush,        [AC_DEFINE(HAVE_GD_IMAGESETBRUSH,    
1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
@@ -275,6 +276,7 @@
   AC_DEFINE(HAVE_LIBGD13,             1, [ ])
   AC_DEFINE(HAVE_LIBGD15,             1, [ ])
   AC_DEFINE(HAVE_LIBGD20,             1, [ ])
+  AC_DEFINE(HAVE_LIBGD204,            1, [ ])  
   AC_DEFINE(HAVE_GD_IMAGESETTILE,     1, [ ])
   AC_DEFINE(HAVE_GD_IMAGESETBRUSH,    1, [ ])
   AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE, 1, [ ])
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.218 php4/ext/gd/gd.c:1.219
--- php4/ext/gd/gd.c:1.218      Tue Oct 29 18:08:01 2002
+++ php4/ext/gd/gd.c    Tue Oct 29 20:05:15 2002
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: gd.c,v 1.218 2002/10/29 23:08:01 rasmus Exp $ */
+/* $Id: gd.c,v 1.219 2002/10/30 01:05:15 iliaa Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, 
    Cold Spring Harbor Labs. */
@@ -1073,10 +1073,19 @@
                io_ctx = gdNewDynamicCtx (8, data);
                if (io_ctx) {
                        if (getmbi((int(*)(void*))gdGetC, io_ctx) == 0 && 
skipheader((int(*)(void*))gdGetC, io_ctx) == 0 ) {
+#if HAVE_LIBGD204
                                io_ctx->gd_free(io_ctx);
+#else
+                               io_ctx->free(io_ctx);
+#endif                                                         
                                return PHP_GDIMG_TYPE_WBM;
-                       } else
+                       } else {
+#if HAVE_LIBGD204
                                io_ctx->gd_free(io_ctx);
+#else
+                               io_ctx->free(io_ctx);
+#endif                                                         
+                       }       
                }
        }
 #endif
@@ -1253,7 +1262,12 @@
                } else {
                        im = (*ioctx_func_p)(io_ctx);
                }
+#if HAVE_LIBGD204
                io_ctx->gd_free(io_ctx);
+#else
+               io_ctx->free(io_ctx);
+#endif                                                                         
+
 #endif         
        }
        else    {
Index: php4/ext/gd/gd_ctx.c
diff -u php4/ext/gd/gd_ctx.c:1.14 php4/ext/gd/gd_ctx.c:1.15
--- php4/ext/gd/gd_ctx.c:1.14   Tue Oct 29 18:08:01 2002
+++ php4/ext/gd/gd_ctx.c        Tue Oct 29 20:05:16 2002
@@ -67,7 +67,11 @@
                ctx = emalloc(sizeof(gdIOCtx));
                ctx->putC = _php_image_output_putc;
                ctx->putBuf = _php_image_output_putbuf;
+#if HAVE_LIBGD204
                ctx->gd_free = _php_image_output_ctxfree;
+#else
+               ctx->free = _php_image_output_ctxfree;
+#endif         
 
 #if APACHE && defined(CHARSET_EBCDIC)
                /* XXX this is unlikely to work any more [EMAIL PROTECTED] */
@@ -94,8 +98,12 @@
                        (*func_p)(im, ctx);
                        break;
        }
-       
+
+#if HAVE_LIBGD204      
        ctx->gd_free(ctx);
+#else
+       ctx->free(ctx);
+#endif         
 
        if(fp) {
                fflush(fp);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to