From 79e28694efe68a7cac4e8e12293f8c81d53e5895 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Thu, 30 Dec 2021 14:09:29 +0100 Subject: [PATCH] Remove AC_HEADER_DIRENT POSIX.1-2001 defines 'struct dirent' in . It replaces the old 'struct direct' found in BSDs. All of the systems that I checked (including FreeBSD, NetBSD, and OpenBSD), now provide with 'struct dirent', as mandated by POSIX. Since autoconf first checks and only if it's missing it checks other header files, it's clear that it will always find , so let's simplify. GNU autoconf documentation declares this macro as obsolescent, and acknowledges that all current systems with directory libraries have : Signed-off-by: Alejandro Colomar --- configure.ac | 1 - lib/defines.h | 17 ++--------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/configure.ac b/configure.ac index 1aa91452..271d1353 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/lib/defines.h b/lib/defines.h index 9790fdab..c35f572d 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -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 -# define DIRECT dirent -#else -# ifdef HAVE_SYS_NDIR_H /* DIR_XENIX */ -# include -# endif -# ifdef HAVE_SYS_DIR_H /* DIR_??? */ -# include -# endif -# ifdef HAVE_NDIR_H /* DIR_BSD */ -# include -# endif -# define DIRECT direct -#endif +#include +#define DIRECT dirent /* * Possible cases: