Skip to content

Commit ea8f2cf

Browse files
authored
ext/gd: conflicting iconv_t typedef breaking the Solaris build. (#22810)
The gd 2.4 sync guarded gdkanji.c's 'typedef void *iconv_t' fallback with HAVE_ICONV_T_DEF, which the bundled build never defined. On Solaris <iconv.h> declares iconv_t as a struct pointer, so it clashed. Define HAVE_ICONV_T_DEF when <iconv.h> already provides iconv_t.
1 parent 6db0378 commit ea8f2cf

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

ext/gd/config.m4

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,14 @@ if test "$PHP_GD" != "no"; then
394394
AC_DEFINE([HAVE_GD_PNG_GET_VERSION_STRING], [1],
395395
[Define to 1 if GD library has the 'gdPngGetVersionString' function.])
396396

397+
dnl Some systems (e.g. Solaris) declare iconv_t in <iconv.h> as something
398+
dnl other than 'void *'. The bundled libgd/gdkanji.c only falls back to its
399+
dnl own 'typedef void *iconv_t' when HAVE_ICONV_T_DEF is undefined, so detect
400+
dnl the system definition to avoid a conflicting typedef.
401+
AC_EGREP_HEADER([typedef.*iconv_t], [iconv.h],
402+
[AC_DEFINE([HAVE_ICONV_T_DEF], [1],
403+
[Define to 1 if <iconv.h> defines iconv_t.])])
404+
397405
dnl Various checks for GD features
398406
PHP_SETUP_ZLIB([GD_SHARED_LIBADD])
399407
PHP_GD_PNG

0 commit comments

Comments
 (0)