Skip to content

Commit a35a69f

Browse files
authored
Clean duplicate headers check (#12710)
- AC_CHECK_HEADERS already includes the header(s) listed in the first argument, so additional net/if.h is redundant. - The crypt.h is checked two times and HAVE_CRYPT_H is only needed in ext/standard. - Remove duplicate <string.h> in ext/standard - Remove duplicate <string.h> in getaddrinfo check in configure.ac
1 parent a6d5f34 commit a35a69f

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

configure.ac

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,6 @@ netinet/in.h \
395395
alloca.h \
396396
arpa/inet.h \
397397
arpa/nameser.h \
398-
crypt.h \
399398
dns.h \
400399
fcntl.h \
401400
grp.h \
@@ -663,7 +662,6 @@ dnl getaddrinfo.
663662
AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
664663
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
665664
[[struct addrinfo *g,h;g=&h;getaddrinfo("","",g,&g);]])],[AC_RUN_IFELSE([AC_LANG_SOURCE([[
666-
#include <string.h>
667665
#include <netdb.h>
668666
#include <sys/types.h>
669667
#include <string.h>

ext/standard/config.m4

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ if test "$PHP_EXTERNAL_LIBCRYPT" != "no"; then
6868

6969
AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
7070
AC_RUN_IFELSE([AC_LANG_SOURCE([[
71-
#include <string.h>
72-
7371
#if HAVE_UNISTD_H
7472
#include <unistd.h>
7573
#endif
@@ -98,8 +96,6 @@ int main(void) {
9896

9997
AC_CACHE_CHECK(for extended DES crypt, ac_cv_crypt_ext_des,[
10098
AC_RUN_IFELSE([AC_LANG_SOURCE([[
101-
#include <string.h>
102-
10399
#if HAVE_UNISTD_H
104100
#include <unistd.h>
105101
#endif
@@ -128,8 +124,6 @@ int main(void) {
128124

129125
AC_CACHE_CHECK(for MD5 crypt, ac_cv_crypt_md5,[
130126
AC_RUN_IFELSE([AC_LANG_SOURCE([[
131-
#include <string.h>
132-
133127
#if HAVE_UNISTD_H
134128
#include <unistd.h>
135129
#endif
@@ -168,8 +162,6 @@ int main(void) {
168162

169163
AC_CACHE_CHECK(for Blowfish crypt, ac_cv_crypt_blowfish,[
170164
AC_RUN_IFELSE([AC_LANG_SOURCE([[
171-
#include <string.h>
172-
173165
#if HAVE_UNISTD_H
174166
#include <unistd.h>
175167
#endif
@@ -205,8 +197,6 @@ int main(void) {
205197

206198
AC_CACHE_CHECK(for SHA512 crypt, ac_cv_crypt_sha512,[
207199
AC_RUN_IFELSE([AC_LANG_SOURCE([[
208-
#include <string.h>
209-
210200
#if HAVE_UNISTD_H
211201
#include <unistd.h>
212202
#endif
@@ -241,8 +231,6 @@ int main(void) {
241231

242232
AC_CACHE_CHECK(for SHA256 crypt, ac_cv_crypt_sha256,[
243233
AC_RUN_IFELSE([AC_LANG_SOURCE([[
244-
#include <string.h>
245-
246234
#if HAVE_UNISTD_H
247235
#include <unistd.h>
248236
#endif
@@ -417,15 +405,16 @@ if test "$PHP_PASSWORD_ARGON2" != "no"; then
417405
fi
418406

419407
dnl
420-
dnl net_get_interfaces
408+
dnl Check net/if.h for net_get_interfaces. Darwin and BSD-like systems need
409+
dnl sys/socket.h to be included with net/if.h.
421410
dnl
422411
AC_CHECK_HEADERS([net/if.h],[], [],
423412
[
424413
#ifdef HAVE_SYS_SOCKET_H
425414
#include <sys/socket.h>
426415
#endif
427-
#include <net/if.h>
428416
])
417+
429418
AC_MSG_CHECKING([for usable getifaddrs])
430419
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
431420
#include <sys/types.h>

0 commit comments

Comments
 (0)