]> granicus.if.org Git - php/commitdiff
Remove AC_HEADER_DIRENT
authorPeter Kokot <peterkokot@gmail.com>
Mon, 3 Sep 2018 22:17:21 +0000 (00:17 +0200)
committerJoe Watkins <krakjoe@php.net>
Tue, 4 Sep 2018 10:01:24 +0000 (12:01 +0200)
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_HEADER_DIRENT`.

This macro checks which header defines the `DIR` type. If `<dirent.h>`
is available it defines the `HAVE_DIRENT_H` symbol. Since the `<dirent.h>`
header is already checked in the `configure.ac`, this check is not needed
anymore. This macro also additionally checks for SCO Xenix (discontinued,
latest release 1989) dir and x libraries. [2]

Commit 6ed790685f9ddae11834f36b0ba4fea58afc805a introduced also
`<sys/dir.h>`. This header exists from times of UNIX System V and
provided definition of DIR type on these systems such as 4.3BSD.
Today `<sys/dir.h>` is kept for backwards compatibility and includes
the `<dirent.h>` on current systems. With `dirent.h>` present this
include is no longer required.

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

Remove unused dirent.h includes

configure.ac
ext/opcache/shared_alloc_shm.c
ext/opcache/zend_shared_alloc.c
ext/standard/dir.c
main/php_scandir.h

index 4758c9289a60f5ac39524ba71904af6d2d58b433..06ae3f406c4013c8cb1d3e116521ccecf44d4abe 100644 (file)
@@ -420,7 +420,6 @@ dnl -------------------------------------------------------------------------
 
 dnl Checks for header files.
 AC_HEADER_STDC
-AC_HEADER_DIRENT
 
 dnl QNX requires unix.h to allow functions in libunix to work properly
 AC_CHECK_HEADERS([ \
index 71d07e21acacc9eee0a5b387b40652753a3798ab..c310290e8e6435ecce6656add1a84fd6dd054cfe 100644 (file)
@@ -29,7 +29,6 @@
 #include <sys/types.h>
 #include <sys/shm.h>
 #include <sys/ipc.h>
-#include <dirent.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
index a40eac3d713fb7ad06b3987e0ecf7588ba13af34..a758214c26356e5b98e43f0bb6d1aa2bbdcbe833 100644 (file)
@@ -28,7 +28,6 @@
 #include <fcntl.h>
 #ifndef ZEND_WIN32
 # include <sys/types.h>
-# include <dirent.h>
 # include <signal.h>
 # include <sys/stat.h>
 # include <stdio.h>
index 82c329c20e375c74c8d0670144c5760f6b7f5647..0e20db34bc1173c63dc84e69471b4f399a8a2cc3 100644 (file)
 #include "php_scandir.h"
 #include "basic_functions.h"
 
-#ifdef HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
index ce31bc200c73ac00cb190e5db062ef7d2af16250..17d5e9e0deca0067d9608ecf382556ef99af7c3b 100644 (file)
 
 #include <sys/types.h>
 
-#ifdef HAVE_SYS_DIR_H
-#include <sys/dir.h>
-#endif
-
 #ifdef PHP_WIN32
 #include "config.w32.h"
 #include "win32/readdir.h"