Skip to content

Commit 8bfcbdc

Browse files
authored
Fix HAVE_LIBGD usage (#15226)
When PHP gd extension uses the external system GD library, the HAVE_LIBGD preprocessor macro gets defined in Autotools. On Windows it was previously always defined when bundled library is used. This fixes the usage and adds help texts.
1 parent 1251901 commit 8bfcbdc

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

ext/gd/config.m4

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ if test "$PHP_GD" != "no"; then
253253
"])
254254

255255
dnl These are always available with bundled library
256-
AC_DEFINE(HAVE_GD_BUNDLED, 1, [ ])
256+
AC_DEFINE([HAVE_GD_BUNDLED], [1],
257+
[Define to 1 if gd extension uses GD library bundled in PHP.])
257258
AC_DEFINE(HAVE_GD_PNG, 1, [ ])
258259
AC_DEFINE(HAVE_GD_BMP, 1, [ ])
259260
AC_DEFINE(HAVE_GD_TGA, 1, [ ])
@@ -284,7 +285,8 @@ dnl Various checks for GD features
284285
PKG_CHECK_MODULES([GDLIB], [gdlib >= 2.1.0])
285286
PHP_EVAL_LIBLINE([$GDLIB_LIBS], [GD_SHARED_LIBADD])
286287
PHP_EVAL_INCLINE([$GDLIB_CFLAGS])
287-
AC_DEFINE(HAVE_LIBGD, 1, [ ])
288+
AC_DEFINE([HAVE_LIBGD], [1],
289+
[Define to 1 gd extension uses external system GD library.])
288290
PHP_GD_CHECK_VERSION
289291

290292
PHP_NEW_EXTENSION([gd], [gd.c $extra_sources], [$ext_shared])

ext/gd/config.w32

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ if (PHP_GD != "no") {
5555
gdtables.c gd_topal.c gd_wbmp.c gdxpm.c wbmp.c gd_xbm.c gd_security.c gd_transform.c \
5656
gd_filter.c gd_pixelate.c gd_rotate.c gd_color_match.c gd_webp.c gd_avif.c \
5757
gd_crop.c gd_interpolation.c gd_matrix.c gd_bmp.c gd_tga.c", "gd");
58-
AC_DEFINE('HAVE_LIBGD', 1, 'GD support');
59-
AC_DEFINE('HAVE_GD_BUNDLED', 1, "Bundled GD");
58+
AC_DEFINE('HAVE_GD_BUNDLED', 1, "Define to 1 if gd extension uses GD library bundled in PHP.");
6059
AC_DEFINE('HAVE_GD_PNG', 1, "PNG support");
6160
AC_DEFINE('HAVE_GD_BMP', 1, "BMP support");
6261
AC_DEFINE('HAVE_GD_TGA', 1, "TGA support");

0 commit comments

Comments
 (0)