Skip to content

Commit 7dd6281

Browse files
committed
Remove HAVE_STDLIB_H
The C89 and later standard defines the `<stdlib.h>` header as part of the standard headers [1] and on current systems it is always present and the `HAVE_STDLIB_H` symbol can be removed. Also Autoconf suggests doing this and relying on C89 or above [2] and [3]. [1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2 [2] http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4 [3] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
1 parent dcc529a commit 7dd6281

File tree

15 files changed

+8
-31
lines changed

15 files changed

+8
-31
lines changed

Zend/Zend.m4

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ sys/types.h \
5757
sys/time.h \
5858
signal.h \
5959
unix.h \
60-
stdlib.h \
6160
cpuid.h \
6261
dlfcn.h)
6362

Zend/configure.ac

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ AH_TOP([
2828
AH_BOTTOM([
2929
#ifndef ZEND_ACCONFIG_H_NO_C_PROTOS
3030
31-
#ifdef HAVE_STDLIB_H
32-
# include <stdlib.h>
33-
#endif
31+
#include <stdlib.h>
3432
3533
#ifdef HAVE_SYS_TYPES_H
3634
# include <sys/types.h>

configure.ac

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ AH_TOP([
3737
AH_BOTTOM([
3838
#ifndef ZEND_ACCONFIG_H_NO_C_PROTOS
3939
40-
#ifdef HAVE_STDLIB_H
41-
# include <stdlib.h>
42-
#endif
40+
#include <stdlib.h>
4341
4442
#ifdef HAVE_SYS_TYPES_H
4543
# include <sys/types.h>
@@ -449,7 +447,6 @@ pwd.h \
449447
resolv.h \
450448
signal.h \
451449
stdarg.h \
452-
stdlib.h \
453450
string.h \
454451
syslog.h \
455452
sysexits.h \

ext/iconv/iconv.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@
2929
#include "SAPI.h"
3030
#include "php_ini.h"
3131

32-
#ifdef HAVE_STDLIB_H
33-
# include <stdlib.h>
34-
#endif
35-
32+
#include <stdlib.h>
3633
#include <errno.h>
3734

3835
#include "php_iconv.h"

ext/mbstring/config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ int main() { return foo(10, "", 3.14); }
9494
])
9595
])
9696
97-
AC_CHECK_HEADERS([stdlib.h string.h strings.h unistd.h sys/time.h sys/times.h stdarg.h limits.h])
97+
AC_CHECK_HEADERS([string.h strings.h unistd.h sys/time.h sys/times.h stdarg.h limits.h])
9898
AC_CHECK_SIZEOF(int, 4)
9999
AC_CHECK_SIZEOF(short, 2)
100100
AC_CHECK_SIZEOF(long, 4)

ext/mbstring/config.w32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if (PHP_MBSTRING != "no") {
1515

1616
ADD_FLAG("CFLAGS_MBSTRING", "-Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl \
1717
-Iext/mbstring/oniguruma /D NOT_RUBY=1 /D LIBMBFL_EXPORTS=1 \
18-
/D HAVE_STDARG_PROTOTYPES=1 /D HAVE_CONFIG_H /D HAVE_STDLIB_H \
18+
/D HAVE_STDARG_PROTOTYPES=1 /D HAVE_CONFIG_H \
1919
/D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /D ONIGURUMA_EXPORT /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1")
2020

2121
FSO.CopyFile("ext\\mbstring\\libmbfl\\config.h.w32",

ext/mbstring/libmbfl/config.h.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@
2020
/* Define to 1 if you have the <stdint.h> header file. */
2121
#undef HAVE_STDINT_H
2222

23-
/* Define to 1 if you have the <stdlib.h> header file. */
24-
#undef HAVE_STDLIB_H
25-
2623
/* Define to 1 if you have the `strcasecmp' function. */
2724
#undef HAVE_STRCASECMP
2825

ext/mbstring/libmbfl/config.h.w32

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#define HAVE_STDIO_H 1
2-
#define HAVE_STDLIB_H 1
32
#define HAVE_MEMORY_H 1
43
/* #undef HAVE_STRINGS_H */
54
#define HAVE_STRING_H 1

ext/mbstring/libmbfl/mbfl/mbfl_allocators.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232
#include "config.h"
3333
#endif
3434

35-
#ifdef HAVE_STDLIB_H
3635
#include <stdlib.h>
37-
#endif
3836

3937
#ifdef HAVE_MEMORY_H
4038
#include <memory.h>

ext/xmlrpc/libxmlrpc/acinclude.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ AC_CHECK_FUNCS( \
1212

1313
AC_DEFUN([XMLRPC_HEADER_CHECKS],[
1414
AC_HEADER_STDC
15-
AC_CHECK_HEADERS(xmlparse.h xmltok.h stdlib.h strings.h string.h)
15+
AC_CHECK_HEADERS(xmlparse.h xmltok.h strings.h string.h)
1616
])
1717

1818
AC_DEFUN([XMLRPC_TYPE_CHECKS],[

0 commit comments

Comments
 (0)