From: Nikita Popov Date: Fri, 7 Aug 2020 10:40:47 +0000 (+0200) Subject: Don't use PHP_DEFINE in iconv X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e6f7784210a587537ddcdad8b058dff81182128e;p=php Don't use PHP_DEFINE in iconv iconv is the only consumer of this custom define mechanism that puts every define into a single file. Use the standard mechanism instead. --- diff --git a/build/Makefile.global b/build/Makefile.global index 61ba37271d..032f7f5042 100644 --- a/build/Makefile.global +++ b/build/Makefile.global @@ -2,7 +2,7 @@ mkinstalldirs = $(top_srcdir)/build/shtool mkdir -p INSTALL = $(top_srcdir)/build/shtool install -c INSTALL_DATA = $(INSTALL) -m 644 -DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir) +DEFS = -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir) COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH) all: $(all_targets) diff --git a/build/php.m4 b/build/php.m4 index 6692298267..34f671e29c 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -1946,7 +1946,6 @@ AC_DEFUN([PHP_SETUP_ICONV], [ found_iconv=yes ],[ AC_CHECK_FUNC(libiconv,[ - PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv]) AC_DEFINE(HAVE_LIBICONV, 1, [ ]) found_iconv=yes ]) @@ -1980,9 +1979,7 @@ AC_DEFUN([PHP_SETUP_ICONV], [ then PHP_CHECK_LIBRARY($iconv_lib_name, libiconv, [ found_iconv=yes - PHP_DEFINE(HAVE_LIBICONV,1,[ext/iconv]) AC_DEFINE(HAVE_LIBICONV,1,[ ]) - PHP_DEFINE([ICONV_ALIASED_LIBICONV],1,[ext/iconv]) AC_DEFINE([ICONV_ALIASED_LIBICONV],1,[iconv() is aliased to libiconv() in -liconv]) ], [ PHP_CHECK_LIBRARY($iconv_lib_name, iconv, [ @@ -1997,7 +1994,6 @@ AC_DEFUN([PHP_SETUP_ICONV], [ fi if test "$found_iconv" = "yes"; then - PHP_DEFINE(HAVE_ICONV,1,[ext/iconv]) AC_DEFINE(HAVE_ICONV,1,[ ]) if test -n "$ICONV_DIR"; then PHP_ADD_LIBRARY_WITH_PATH($iconv_lib_name, $ICONV_DIR/$PHP_LIBDIR, $1) diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4 index 52de38dd2c..b3291e41c3 100644 --- a/ext/iconv/config.m4 +++ b/ext/iconv/config.m4 @@ -96,29 +96,22 @@ int main() { case "$iconv_impl_name" in gnu_libiconv [)] - PHP_DEFINE([PHP_ICONV_IMPL],[\"libiconv\"],[ext/iconv]) AC_DEFINE([PHP_ICONV_IMPL],["libiconv"],[Which iconv implementation to use]) - PHP_DEFINE([HAVE_LIBICONV],1,[ext/iconv]) + AC_DEFINE([HAVE_LIBICONV],1,[Whether libiconv is used]) PHP_ADD_LIBRARY_WITH_PATH(iconv, "$PHP_ICONV_PREFIX/$PHP_LIBDIR", ICONV_SHARED_LIBADD) ;; bsd [)] - PHP_DEFINE([HAVE_BSD_ICONV],1,[ext/iconv]) AC_DEFINE([HAVE_BSD_ICONV],1,[Konstantin Chuguev's iconv implementation]) - PHP_DEFINE([PHP_ICONV_IMPL],[\"BSD iconv\"],[ext/iconv]) AC_DEFINE([PHP_ICONV_IMPL],["BSD iconv"],[Which iconv implementation to use]) ;; glibc [)] - PHP_DEFINE([HAVE_GLIBC_ICONV],1,[ext/iconv]) AC_DEFINE([HAVE_GLIBC_ICONV],1,[glibc's iconv implementation]) - PHP_DEFINE([PHP_ICONV_IMPL],[\"glibc\"],[ext/iconv]) AC_DEFINE([PHP_ICONV_IMPL],["glibc"],[Which iconv implementation to use]) ;; ibm [)] - PHP_DEFINE([HAVE_IBM_ICONV],1,[ext/iconv]) AC_DEFINE([HAVE_IBM_ICONV],1,[IBM iconv implementation]) - PHP_DEFINE([PHP_ICONV_IMPL],[\"IBM iconv\"],[ext/iconv]) AC_DEFINE([PHP_ICONV_IMPL],["IBM iconv"],[Which iconv implementation to use]) ;; esac @@ -172,15 +165,12 @@ int main() { } ]])],[ AC_MSG_RESULT(yes) - PHP_DEFINE([ICONV_BROKEN_IGNORE],0,[ext/iconv]) AC_DEFINE([ICONV_BROKEN_IGNORE],0,[Whether iconv supports IGNORE]) ],[ AC_MSG_RESULT(no) - PHP_DEFINE([ICONV_BROKEN_IGNORE],1,[ext/iconv]) AC_DEFINE([ICONV_BROKEN_IGNORE],1,[Whether iconv supports IGNORE]) ],[ AC_MSG_RESULT(no, cross-compiling) - PHP_DEFINE([ICONV_BROKEN_IGNORE],0,[ext/iconv]) AC_DEFINE([ICONV_BROKEN_IGNORE],0,[Whether iconv supports IGNORE]) ]) @@ -190,7 +180,6 @@ int main() { #include FOO ]], [])], [ AC_MSG_RESULT([yes]) - PHP_DEFINE([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>],[ext/iconv]) AC_DEFINE_UNQUOTED([PHP_ICONV_H_PATH], [<$PHP_ICONV_H_PATH>], [Path to iconv.h]) ], [ AC_MSG_RESULT([no]) diff --git a/ext/iconv/php_iconv.h b/ext/iconv/php_iconv.h index 23cfdb09e9..89506fab53 100644 --- a/ext/iconv/php_iconv.h +++ b/ext/iconv/php_iconv.h @@ -33,18 +33,6 @@ #include "php_version.h" #define PHP_ICONV_VERSION PHP_VERSION -#ifdef PHP_ATOM_INC -#include "ext/iconv/php_have_iconv.h" -#include "ext/iconv/php_have_libiconv.h" -#include "ext/iconv/php_iconv_aliased_libiconv.h" -#include "ext/iconv/php_have_glibc_iconv.h" -#include "ext/iconv/php_have_bsd_iconv.h" -#include "ext/iconv/php_have_ibm_iconv.h" -#include "ext/iconv/php_iconv_supports_errno.h" -#include "ext/iconv/php_php_iconv_impl.h" -#include "ext/iconv/php_php_iconv_h_path.h" -#endif - #ifdef HAVE_ICONV extern zend_module_entry iconv_module_entry; #define iconv_module_ptr &iconv_module_entry