From aa092ccf6ab48f7e0c154a6c12b40c5a120500be Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 8 Oct 2009 09:35:51 -0600 Subject: [PATCH] maint: remove unused macros and declarations * src/system.h (EDQUOT, EISDIR, ENOSYS, EOVERFLOW, F_OK, X_OK) (W_OK, R_OK): Delete; macros provided by gnulib. (includes): Gnulib guarantees both and , in either order. (free, malloc, memchr, realloc, getenv, lseek): Delete, gnulib guarantees these declarations. * m4/check-decl.m4 (gl_CHECK_DECLS): Delete checks now done by gnulib. --- m4/check-decl.m4 | 8 +------ src/system.h | 59 ++++-------------------------------------------- 2 files changed, 5 insertions(+), 62 deletions(-) diff --git a/m4/check-decl.m4 b/m4/check-decl.m4 index d1a520a71..530c59e16 100644 --- a/m4/check-decl.m4 +++ b/m4/check-decl.m4 @@ -1,4 +1,4 @@ -#serial 24 +#serial 25 # Check declarations for this package. dnl Copyright (C) 1997-2001, 2003-2006, 2008-2009 Free Software @@ -37,13 +37,7 @@ AC_DEFUN([gl_CHECK_DECLS], AC_CHECK_DECLS([isblank], [], [], [#include ]) - AC_CHECK_DECLS_ONCE([free]) - AC_CHECK_DECLS_ONCE([getenv]) AC_CHECK_DECLS_ONCE([geteuid]) AC_CHECK_DECLS_ONCE([getlogin]) AC_CHECK_DECLS_ONCE([getuid]) - AC_CHECK_DECLS_ONCE([lseek]) - AC_CHECK_DECLS_ONCE([malloc]) - AC_CHECK_DECLS_ONCE([memchr]) - AC_CHECK_DECLS_ONCE([realloc]) ]) diff --git a/src/system.h b/src/system.h index f3e26a835..8de0f3cd2 100644 --- a/src/system.h +++ b/src/system.h @@ -44,16 +44,8 @@ you must include before including this file #include "configmake.h" -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif +#include +#include /* Since major is a function on SVR4, we can't use `ifndef major'. */ #if MAJOR_IN_MKDEV @@ -86,16 +78,8 @@ you must include before including this file #include -/* Some systems don't define the following symbols. */ -#ifndef EDQUOT -# define EDQUOT (-1) -#endif -#ifndef EISDIR -# define EISDIR (-1) -#endif -#ifndef ENOSYS -# define ENOSYS (-1) -#endif +/* Some systems don't define this; POSIX mentions it but says it is + obsolete, so gnulib does not provide it either. */ #ifndef ENODATA # define ENODATA (-1) #endif @@ -125,13 +109,6 @@ initialize_exit_failure (int status) #include -#ifndef F_OK -# define F_OK 0 -# define X_OK 1 -# define W_OK 2 -# define R_OK 4 -#endif - #include #ifndef _D_EXACT_NAMLEN # define _D_EXACT_NAMLEN(dp) strlen ((dp)->d_name) @@ -281,30 +258,6 @@ select_plural (uintmax_t n) #define STREQ(a, b) (strcmp (a, b) == 0) -#if !HAVE_DECL_FREE -void free (); -#endif - -#if !HAVE_DECL_MALLOC -char *malloc (); -#endif - -#if !HAVE_DECL_MEMCHR -char *memchr (); -#endif - -#if !HAVE_DECL_REALLOC -char *realloc (); -#endif - -#if !HAVE_DECL_GETENV -char *getenv (); -#endif - -#if !HAVE_DECL_LSEEK -off_t lseek (); -#endif - #if !HAVE_DECL_GETLOGIN char *getlogin (); #endif @@ -549,10 +502,6 @@ enum while (0) #endif -#ifndef EOVERFLOW -# define EOVERFLOW EINVAL -#endif - #if ! HAVE_SYNC # define sync() /* empty */ #endif