From a700451706b1a6da75f08a6a7e331635e17a6e99 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Thu, 28 Feb 2019 00:41:30 +0100 Subject: [PATCH] Remove obsolescent AC_HEADER_STDC and memcpy check Autoconf 2.59d (released in 2006) [1] started promoting several macros as not relevant for newer systems anymore, including the `AC_HEADER_STDC`. This macro checks if given system has C89 compliant header files such as ``, ``, ``, ``,... and defines the `STDC_HEADERS` symbol [2]. Case is that current systems should be well supported with at least C89 standard headers [3]. Given headers are still additionally checked with the `AC_PROG_CC` macro, yet not needed anyway. Additionally, the HAVE_MEMCPY check has been removed. The memcpy function is standardized by C89 and later. Refs: [1] http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS [2] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html [3] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2 --- Zend/Zend.m4 | 3 +-- acinclude.m4 | 4 ---- configure.ac | 4 ---- ext/json/config.m4 | 1 - ext/mbstring/libmbfl/config.h.in | 3 --- ext/xmlrpc/libxmlrpc/acinclude.m4 | 3 +-- main/php.h | 12 +----------- win32/build/config.w32.h.in | 2 -- 8 files changed, 3 insertions(+), 29 deletions(-) diff --git a/Zend/Zend.m4 b/Zend/Zend.m4 index 885af154faa..392d28ef72b 100644 --- a/Zend/Zend.m4 +++ b/Zend/Zend.m4 @@ -29,7 +29,6 @@ AC_DEFUN([LIBZEND_BASIC_CHECKS],[ AC_REQUIRE([AC_PROG_YACC]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_CC_C_O]) -AC_REQUIRE([AC_HEADER_STDC]) LIBZEND_BISON_CHECK @@ -79,7 +78,7 @@ LIBZEND_CHECK_INT_TYPE(uint32_t) dnl Checks for library functions. AC_FUNC_ALLOCA -AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite fpclass sigsetjmp) +AC_CHECK_FUNCS(strdup getpid kill strtod strtol finite fpclass sigsetjmp) AC_CHECK_DECLS([isfinite, isnan, isinf], [], [], [[#include ]]) diff --git a/acinclude.m4 b/acinclude.m4 index 2c6f4b7dc85..181874390b6 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1030,10 +1030,8 @@ AC_DEFUN([_PHP_CHECK_SIZEOF], [ old_LDFLAGS=$LDFLAGS LDFLAGS= AC_RUN_IFELSE([AC_LANG_SOURCE([[#include -#if STDC_HEADERS #include #include -#endif #ifdef HAVE_INTTYPES_H #include #endif @@ -1103,10 +1101,8 @@ AC_CACHE_VAL(ac_cv_type_in_addr_t, changequote(<<,>>)dnl <>dnl changequote([,]), [#include -#if STDC_HEADERS #include #include -#endif #ifdef HAVE_NETINET_IN_H #include #endif], ac_cv_type_in_addr_t=yes, ac_cv_type_in_addr_t=no)])dnl diff --git a/configure.ac b/configure.ac index 57705d294a8..45845cdde5d 100644 --- a/configure.ac +++ b/configure.ac @@ -417,9 +417,6 @@ PHP_CHECK_FUNC(inet_aton, resolv, bind) dnl Then headers. dnl ------------------------------------------------------------------------- -dnl Checks for header files. -AC_HEADER_STDC - dnl QNX requires unix.h to allow functions in libunix to work properly AC_CHECK_HEADERS([ \ inttypes.h \ @@ -629,7 +626,6 @@ localtime_r \ lockf \ lchown \ lrand48 \ -memcpy \ memmove \ mkstemp \ mmap \ diff --git a/ext/json/config.m4 b/ext/json/config.m4 index 882e39b242a..ba255820c29 100644 --- a/ext/json/config.m4 +++ b/ext/json/config.m4 @@ -5,7 +5,6 @@ PHP_ARG_ENABLE(json, whether to enable JavaScript Object Serialization support, if test "$PHP_JSON" != "no"; then AC_DEFINE([HAVE_JSON],1 ,[whether to enable JavaScript Object Serialization support]) - AC_HEADER_STDC PHP_NEW_EXTENSION(json, json.c \ diff --git a/ext/mbstring/libmbfl/config.h.in b/ext/mbstring/libmbfl/config.h.in index 8d3cd739c00..fba649b0c43 100644 --- a/ext/mbstring/libmbfl/config.h.in +++ b/ext/mbstring/libmbfl/config.h.in @@ -63,9 +63,6 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - /* Version number of package */ #undef VERSION diff --git a/ext/xmlrpc/libxmlrpc/acinclude.m4 b/ext/xmlrpc/libxmlrpc/acinclude.m4 index b425377b826..d73ae8cc357 100644 --- a/ext/xmlrpc/libxmlrpc/acinclude.m4 +++ b/ext/xmlrpc/libxmlrpc/acinclude.m4 @@ -6,12 +6,11 @@ AC_DEFUN([XMLRPC_FUNCTION_CHECKS],[ AC_CHECK_FUNCS( \ strtoul strtoull snprintf \ strstr strpbrk strerror\ - memcpy memmove) + memmove) ]) AC_DEFUN([XMLRPC_HEADER_CHECKS],[ -AC_HEADER_STDC AC_CHECK_HEADERS(xmlparse.h xmltok.h strings.h) ]) diff --git a/main/php.h b/main/php.h index 317a0484057..066685cf9b4 100644 --- a/main/php.h +++ b/main/php.h @@ -230,17 +230,7 @@ typedef unsigned int socklen_t; #include "zend_hash.h" #include "zend_alloc.h" #include "zend_stack.h" - -#if STDC_HEADERS -# include -#else -# ifndef HAVE_MEMCPY -# define memcpy(d, s, n) bcopy((s), (d), (n)) -# endif -# ifndef HAVE_MEMMOVE -# define memmove(d, s, n) bcopy ((s), (d), (n)) -# endif -#endif +#include #ifndef HAVE_STRERROR char *strerror(int); diff --git a/win32/build/config.w32.h.in b/win32/build/config.w32.h.in index ccfad0ab166..1c4c691847e 100644 --- a/win32/build/config.w32.h.in +++ b/win32/build/config.w32.h.in @@ -69,13 +69,11 @@ #undef HAVE_STRUCT_STAT_ST_BLKSIZE #undef HAVE_STRUCT_STAT_ST_BLOCKS #define HAVE_STRUCT_STAT_ST_RDEV 1 -#define STDC_HEADERS 1 #define REGEX 1 #define HSREGEX 1 #define HAVE_GCVT 1 #define HAVE_GETLOGIN 1 #define HAVE_GETTIMEOFDAY 1 -#define HAVE_MEMCPY 1 #define HAVE_MEMMOVE 1 #define HAVE_PUTENV 1 #define HAVE_REGCOMP 1