summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/gd/config.m41
-rw-r--r--ext/gd/gd.c13
-rw-r--r--ext/gd/libgd/gd_compat.h4
3 files changed, 5 insertions, 13 deletions
diff --git a/ext/gd/config.m4 b/ext/gd/config.m4
index 255035a924..dc38562935 100644
--- a/ext/gd/config.m4
+++ b/ext/gd/config.m4
@@ -288,6 +288,7 @@ AC_DEFUN([PHP_GD_CHECK_VERSION],[
PHP_CHECK_LIBRARY(gd, gdImagePixelate, [AC_DEFINE(HAVE_GD_IMAGE_PIXELATE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
PHP_CHECK_LIBRARY(gd, gdImageFlipBoth, [AC_DEFINE(HAVE_GD_IMAGE_FLIP, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
PHP_CHECK_LIBRARY(gd, gdImageCreateFromJpegEx,[AC_DEFINE(HAVE_GD_JPGEX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
+ PHP_CHECK_LIBRARY(gd, gdImageCreateFromXbm, [AC_DEFINE(HAVE_GD_XBM, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
PHP_CHECK_LIBRARY(gd, gdSetErrorMethod, [AC_DEFINE(HAVE_LIBGD21, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
])
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 5d8ae4e6c6..94b057fb16 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -53,13 +53,6 @@
# include <Wingdi.h>
#endif
-#if HAVE_LIBGD
-#if !HAVE_GD_BUNDLED
-# include "libgd/gd_compat.h"
-#else
-extern int overflow2(int a, int b);
-#endif
-
static int le_gd, le_gd_font;
#if HAVE_LIBT1
#include <t1lib.h>
@@ -2396,17 +2389,19 @@ PHP_FUNCTION(imagetypes)
/* {{{ _php_ctx_getmbi
*/
-static _php_ctx_getmbi(gdIOCtx *ctx)
+static int _php_ctx_getmbi(gdIOCtx *ctx)
{
int i, mbi = 0;
do {
i = (ctx->getC)(ctx);
if (i < 0) {
- break;
+ return -1;
}
mbi = (mbi << 7) | (i & 0x7f);
} while (i & 0x80);
+
+ return mbi;
}
/* }}} */
diff --git a/ext/gd/libgd/gd_compat.h b/ext/gd/libgd/gd_compat.h
index 745fe80f70..f6e00d7fa0 100644
--- a/ext/gd/libgd/gd_compat.h
+++ b/ext/gd/libgd/gd_compat.h
@@ -12,10 +12,6 @@ const char * gdJpegGetVersionString();
int gdJpegGetVersionInt();
#if !defined(HAVE_LIBGD21)
-int overflow2(int a, int b);
-int getmbi (int (*getin) (void *in), void *in);
-int skipheader (int (*getin) (void *in), void *in);
-
/* filters section
*