Remove unnecessary header checks and include guards.

* configure.ac (AC_CHECK_HEADERS): Remove checks for header files
that gnulib either assumes are always present, or provides
itself.  These include errno.h fcntl.h inttypes.h limits.h
locale.h stddef.h stdint.h stdlib.h string.h sys/types.h
unistd.h.
* lib/buildcmd.c: Remove include guard for limits.h.
* find/fstype.c: Remove include guard for sys/types.h.
* lib/savedirinfo.c: Likewise.
* find/find.c: Remove include guard for locale.h.
* find/ftsfind.c: Likewise.
This commit is contained in:
James Youngman 2011-06-02 12:22:22 +01:00
parent f4171f93f1
commit f3d4ac9bb4
7 changed files with 19 additions and 26 deletions

View File

@ -1,3 +1,17 @@
2011-06-02 James Youngman <jay@gnu.org>
Remove unnecessary header checks and include guards.
* configure.ac (AC_CHECK_HEADERS): Remove checks for header files
that gnulib either assumes are always present, or provides
itself. These include errno.h fcntl.h inttypes.h limits.h
locale.h stddef.h stdint.h stdlib.h string.h sys/types.h
unistd.h.
* lib/buildcmd.c: Remove include guard for limits.h.
* find/fstype.c: Remove include guard for sys/types.h.
* lib/savedirinfo.c: Likewise.
* find/find.c: Remove include guard for locale.h.
* find/ftsfind.c: Likewise.
2011-06-01 James Youngman <jay@gnu.org>
Better error handling for the result of set_fstype_devno.

View File

@ -119,15 +119,13 @@ AC_SUBST([FINDLIBS])
dnl Checks for header files.
AC_HEADER_STDC
dnl Assume unistd.h is present - coreutils does too.
AC_CHECK_HEADERS(fcntl.h string.h limits.h errno.h stdlib.h stddef.h)
AC_CHECK_HEADERS(unistd.h sys/types.h inttypes.h fcntl.h locale.h stdint.h)
AC_CHECK_HEADERS(sys/param.h mntent.h sys/mnttab.h sys/mntio.h sys/mkdev.h)
dnl find.c needs sys/utsname.h because it calls uname(2).
AC_CHECK_HEADERS(sys/utsname.h)
dnl fdleak.c needs sys/resource.h because it calls getrlimit(2).
AC_CHECK_HEADERS(sys/resource.h)
AC_HEADER_MAJOR
dnl TODO: it's possible gnulib eliminates the need for AC_HEADER_DIRENT.
AC_HEADER_DIRENT
AC_HEADER_STAT
AC_HEADER_SYS_WAIT

View File

@ -37,6 +37,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <locale.h>
#include "fcntl--.h"
#include "xalloc.h"
@ -53,10 +54,6 @@
#include "progname.h"
#include "save-cwd.h"
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
#if ENABLE_NLS
# include <libintl.h>
# define _(Text) gettext (Text)

View File

@ -27,9 +27,7 @@
#include <errno.h>
#include <stdbool.h>
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include <sys/stat.h>
/* The presence of unistd.h is assumed by gnulib these days, so we

View File

@ -38,10 +38,10 @@
#include <errno.h>
#include <assert.h>
#include <locale.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include "progname.h"
@ -56,10 +56,6 @@
#include "fdleak.h"
#include "unused-result.h"
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
#if ENABLE_NLS
# include <libintl.h>
# define _(Text) gettext (Text)

View File

@ -23,6 +23,8 @@
#include <wchar.h>
#include <locale.h>
#include <stdbool.h>
#include <limits.h>
#if ENABLE_NLS
# include <libintl.h>
@ -43,10 +45,6 @@
#include <sys/param.h>
#endif
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
/* The presence of unistd.h is assumed by gnulib these days, so we
* might as well assume it too.
*/

View File

@ -22,16 +22,8 @@
#include <config.h>
#include <sys/stat.h>
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
/* The presence of unistd.h is assumed by gnulib these days, so we
* might as well assume it too.
*/
#include <unistd.h>
#include <errno.h>
#if HAVE_DIRENT_H