]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Remove AC_HEADER_DIRENT
authorAlejandro Colomar <alx.manpages@gmail.com>
Thu, 30 Dec 2021 13:09:29 +0000 (14:09 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sat, 15 Jan 2022 14:25:53 +0000 (08:25 -0600)
POSIX.1-2001 defines 'struct dirent' in <dirent.h>.  It replaces
the old 'struct direct' found in BSDs.  All of the systems that I
checked (including FreeBSD, NetBSD, and OpenBSD), now provide
<dirent.h> with 'struct dirent', as mandated by POSIX.

Since autoconf first checks <dirent.h> and only if it's missing it
checks other header files, it's clear that it will always find
<dirent.h>, so let's simplify.

GNU autoconf documentation declares this macro as obsolescent, and
acknowledges that all current systems with directory libraries
have <dirent.h>:
<https://www.gnu.org/software/autoconf/manual/autoconf-2.70/html_node/Particular-Headers.html>

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
configure.ac
lib/defines.h

index 1aa91452923cc29027326cd88322696bb62cd4bd..271d13531819e954b5e5cba15e3f4ecd42209a9c 100644 (file)
@@ -37,7 +37,6 @@ AM_PROG_LIBTOOL
 dnl Checks for libraries.
 
 dnl Checks for header files.
-AC_HEADER_DIRENT
 AC_HEADER_SYS_WAIT
 AC_HEADER_STDBOOL
 
index 9790fdaba4c9de7b1e7f42627086a5785f75b7d6..c35f572d6db34db40681abf6e810987949fabeb5 100644 (file)
@@ -117,21 +117,8 @@ static inline void memzero(void *ptr, size_t size)
 
 #define strzero(s) memzero(s, strlen(s))       /* warning: evaluates twice */
 
-#ifdef HAVE_DIRENT_H           /* DIR_SYSV */
-# include <dirent.h>
-# define DIRECT dirent
-#else
-# ifdef HAVE_SYS_NDIR_H                /* DIR_XENIX */
-#  include <sys/ndir.h>
-# endif
-# ifdef HAVE_SYS_DIR_H         /* DIR_??? */
-#  include <sys/dir.h>
-# endif
-# ifdef HAVE_NDIR_H            /* DIR_BSD */
-#  include <ndir.h>
-# endif
-# define DIRECT direct
-#endif
+#include <dirent.h>
+#define DIRECT dirent
 
 /*
  * Possible cases: