Skip to content

Commit a700451

Browse files
committed
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 `<string.h>`, `<stdlib.h>`, `<stdarg.h>`, `<float.h>`,... 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
1 parent 7c351ba commit a700451

File tree

8 files changed

+3
-29
lines changed

8 files changed

+3
-29
lines changed

Zend/Zend.m4

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ AC_DEFUN([LIBZEND_BASIC_CHECKS],[
2929
AC_REQUIRE([AC_PROG_YACC])
3030
AC_REQUIRE([AC_PROG_CC])
3131
AC_REQUIRE([AC_PROG_CC_C_O])
32-
AC_REQUIRE([AC_HEADER_STDC])
3332
3433
LIBZEND_BISON_CHECK
3534
@@ -79,7 +78,7 @@ LIBZEND_CHECK_INT_TYPE(uint32_t)
7978
8079
dnl Checks for library functions.
8180
AC_FUNC_ALLOCA
82-
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite fpclass sigsetjmp)
81+
AC_CHECK_FUNCS(strdup getpid kill strtod strtol finite fpclass sigsetjmp)
8382
8483
AC_CHECK_DECLS([isfinite, isnan, isinf], [], [], [[#include <math.h>]])
8584

acinclude.m4

-4
Original file line numberDiff line numberDiff line change
@@ -1030,10 +1030,8 @@ AC_DEFUN([_PHP_CHECK_SIZEOF], [
10301030
old_LDFLAGS=$LDFLAGS
10311031
LDFLAGS=
10321032
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
1033-
#if STDC_HEADERS
10341033
#include <stdlib.h>
10351034
#include <stddef.h>
1036-
#endif
10371035
#ifdef HAVE_INTTYPES_H
10381036
#include <inttypes.h>
10391037
#endif
@@ -1103,10 +1101,8 @@ AC_CACHE_VAL(ac_cv_type_in_addr_t,
11031101
changequote(<<,>>)dnl
11041102
<<in_addr_t[^a-zA-Z_0-9]>>dnl
11051103
changequote([,]), [#include <sys/types.h>
1106-
#if STDC_HEADERS
11071104
#include <stdlib.h>
11081105
#include <stddef.h>
1109-
#endif
11101106
#ifdef HAVE_NETINET_IN_H
11111107
#include <netinet/in.h>
11121108
#endif], ac_cv_type_in_addr_t=yes, ac_cv_type_in_addr_t=no)])dnl

configure.ac

-4
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,6 @@ PHP_CHECK_FUNC(inet_aton, resolv, bind)
417417
dnl Then headers.
418418
dnl -------------------------------------------------------------------------
419419

420-
dnl Checks for header files.
421-
AC_HEADER_STDC
422-
423420
dnl QNX requires unix.h to allow functions in libunix to work properly
424421
AC_CHECK_HEADERS([ \
425422
inttypes.h \
@@ -629,7 +626,6 @@ localtime_r \
629626
lockf \
630627
lchown \
631628
lrand48 \
632-
memcpy \
633629
memmove \
634630
mkstemp \
635631
mmap \

ext/json/config.m4

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ PHP_ARG_ENABLE(json, whether to enable JavaScript Object Serialization support,
55

66
if test "$PHP_JSON" != "no"; then
77
AC_DEFINE([HAVE_JSON],1 ,[whether to enable JavaScript Object Serialization support])
8-
AC_HEADER_STDC
98

109
PHP_NEW_EXTENSION(json,
1110
json.c \

ext/mbstring/libmbfl/config.h.in

-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@
6363
/* Define to the version of this package. */
6464
#undef PACKAGE_VERSION
6565

66-
/* Define to 1 if you have the ANSI C header files. */
67-
#undef STDC_HEADERS
68-
6966
/* Version number of package */
7067
#undef VERSION
7168

ext/xmlrpc/libxmlrpc/acinclude.m4

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ AC_DEFUN([XMLRPC_FUNCTION_CHECKS],[
66
AC_CHECK_FUNCS( \
77
strtoul strtoull snprintf \
88
strstr strpbrk strerror\
9-
memcpy memmove)
9+
memmove)
1010
1111
])
1212

1313
AC_DEFUN([XMLRPC_HEADER_CHECKS],[
14-
AC_HEADER_STDC
1514
AC_CHECK_HEADERS(xmlparse.h xmltok.h strings.h)
1615
])
1716

main/php.h

+1-11
Original file line numberDiff line numberDiff line change
@@ -230,17 +230,7 @@ typedef unsigned int socklen_t;
230230
#include "zend_hash.h"
231231
#include "zend_alloc.h"
232232
#include "zend_stack.h"
233-
234-
#if STDC_HEADERS
235-
# include <string.h>
236-
#else
237-
# ifndef HAVE_MEMCPY
238-
# define memcpy(d, s, n) bcopy((s), (d), (n))
239-
# endif
240-
# ifndef HAVE_MEMMOVE
241-
# define memmove(d, s, n) bcopy ((s), (d), (n))
242-
# endif
243-
#endif
233+
#include <string.h>
244234

245235
#ifndef HAVE_STRERROR
246236
char *strerror(int);

win32/build/config.w32.h.in

-2
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,11 @@
6969
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
7070
#undef HAVE_STRUCT_STAT_ST_BLOCKS
7171
#define HAVE_STRUCT_STAT_ST_RDEV 1
72-
#define STDC_HEADERS 1
7372
#define REGEX 1
7473
#define HSREGEX 1
7574
#define HAVE_GCVT 1
7675
#define HAVE_GETLOGIN 1
7776
#define HAVE_GETTIMEOFDAY 1
78-
#define HAVE_MEMCPY 1
7977
#define HAVE_MEMMOVE 1
8078
#define HAVE_PUTENV 1
8179
#define HAVE_REGCOMP 1

0 commit comments

Comments
 (0)