# HG changeset patch # User Paul Eggert # Date 1054754549 0 # Node ID df44e79ce676ab94f8998b587b77ac79faab4514 # Parent d83f80bb7c431c5efebad1983d5104ff05696365 .h files should stand alone, but we shouldn't include if we can get away with just . diff --git a/lib/ChangeLog b/lib/ChangeLog --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,4 +1,21 @@ -2002-08-05 Paul Eggert +2003-06-04 Paul Eggert + + .h files should stand alone, but we shouldn't include + if we can get away with just . + + * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c, + malloc.c, putenv.c, realloc.c, strcasecmp.c: Include + rather than , as we merely need size_t. + * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include , + to get size_t. + * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h: + Include , to get FILE. + * memcasecmp.c: Don't include , as we can assume + memcasecmp.h has included and all we need is size_t. + * memcoll.c: Include "memcoll.h", which gets us size_t and checks + our interface, instead of including + +2003-06-02 Paul Eggert [from coreutils] Fix some minor time-related bugs with POSIX time arguments. diff --git a/lib/__fpending.h b/lib/__fpending.h --- a/lib/__fpending.h +++ b/lib/__fpending.h @@ -2,14 +2,13 @@ # include #endif +#include #include #if HAVE_STDIO_EXT_H # include #endif -#include - #ifndef HAVE_DECL___FPENDING "this configure-time declaration test was not run" #endif diff --git a/lib/addext.c b/lib/addext.c --- a/lib/addext.c +++ b/lib/addext.c @@ -36,7 +36,7 @@ # define _POSIX_NAME_MAX 14 #endif -#include +#include #if HAVE_STRING_H # include #else diff --git a/lib/backupfile.c b/lib/backupfile.c --- a/lib/backupfile.c +++ b/lib/backupfile.c @@ -25,8 +25,8 @@ # include #endif +#include #include -#include #if HAVE_STRING_H # include #else diff --git a/lib/dirname.h b/lib/dirname.h --- a/lib/dirname.h +++ b/lib/dirname.h @@ -17,6 +17,8 @@ #ifndef DIRNAME_H_ # define DIRNAME_H_ 1 +# include + # ifndef PARAMS # if defined PROTOTYPES || (defined __STDC__ && __STDC__) # define PARAMS(Args) Args diff --git a/lib/exclude.c b/lib/exclude.c --- a/lib/exclude.c +++ b/lib/exclude.c @@ -30,10 +30,8 @@ #ifndef errno extern int errno; #endif +#include #include -#if HAVE_SYS_TYPES_H -# include -#endif #if HAVE_STDLIB_H # include #endif diff --git a/lib/getline.c b/lib/getline.c --- a/lib/getline.c +++ b/lib/getline.c @@ -31,8 +31,8 @@ # define _GNU_SOURCE 1 #endif +#include #include -#include #if defined __GNU_LIBRARY__ && HAVE_GETDELIM diff --git a/lib/hash.h b/lib/hash.h --- a/lib/hash.h +++ b/lib/hash.h @@ -24,6 +24,8 @@ #ifndef HASH_H_ # define HASH_H_ +# include + # ifndef PARAMS # if PROTOTYPES || __STDC__ # define PARAMS(Args) Args diff --git a/lib/linebuffer.h b/lib/linebuffer.h --- a/lib/linebuffer.h +++ b/lib/linebuffer.h @@ -20,6 +20,8 @@ #if !defined LINEBUFFER_H # define LINEBUFFER_H +# include + /* A `struct linebuffer' holds a line of text. */ struct linebuffer diff --git a/lib/malloc.c b/lib/malloc.c --- a/lib/malloc.c +++ b/lib/malloc.c @@ -22,7 +22,7 @@ #endif #undef malloc -#include +#include char *malloc (); diff --git a/lib/memcasecmp.c b/lib/memcasecmp.c --- a/lib/memcasecmp.c +++ b/lib/memcasecmp.c @@ -21,7 +21,6 @@ # include #endif -#include #include #if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) diff --git a/lib/memcasecmp.h b/lib/memcasecmp.h --- a/lib/memcasecmp.h +++ b/lib/memcasecmp.h @@ -1,3 +1,5 @@ +#include + #ifndef PARAMS # if defined PROTOTYPES || (defined __STDC__ && __STDC__) # define PARAMS(Args) Args diff --git a/lib/memcoll.c b/lib/memcoll.c --- a/lib/memcoll.c +++ b/lib/memcoll.c @@ -21,13 +21,13 @@ # include #endif +#include "memcoll.h" + #include #ifndef errno extern int errno; #endif -#include - #if HAVE_STRING_H # include #endif diff --git a/lib/memcoll.h b/lib/memcoll.h --- a/lib/memcoll.h +++ b/lib/memcoll.h @@ -5,6 +5,8 @@ # include # endif +# include + # ifndef PARAMS # if defined PROTOTYPES || (defined __STDC__ && __STDC__) # define PARAMS(Args) Args diff --git a/lib/putenv.c b/lib/putenv.c --- a/lib/putenv.c +++ b/lib/putenv.c @@ -21,7 +21,7 @@ # include #endif -#include +#include /* Include errno.h *after* sys/types.h to work around header problems on AIX 3.2.5. */ diff --git a/lib/readtokens.h b/lib/readtokens.h --- a/lib/readtokens.h +++ b/lib/readtokens.h @@ -1,6 +1,28 @@ +/* readtokens.h -- Functions for reading tokens from an input stream. + + Copyright (C) 1990, 1991, 1999, 2001, 2003 Jim Meyering. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + Written by Jim Meyering. */ + #ifndef H_READTOKENS_H # define H_READTOKENS_H +# include + # ifndef INITIAL_TOKEN_LENGTH # define INITIAL_TOKEN_LENGTH 20 # endif diff --git a/lib/realloc.c b/lib/realloc.c --- a/lib/realloc.c +++ b/lib/realloc.c @@ -22,7 +22,7 @@ #endif #undef realloc -#include +#include char *malloc (); char *realloc (); diff --git a/lib/stdio-safer.h b/lib/stdio-safer.h --- a/lib/stdio-safer.h +++ b/lib/stdio-safer.h @@ -1,3 +1,5 @@ +#include + #ifndef PARAMS # if defined PROTOTYPES || (defined __STDC__ && __STDC__) # define PARAMS(Args) Args diff --git a/lib/strcasecmp.c b/lib/strcasecmp.c --- a/lib/strcasecmp.c +++ b/lib/strcasecmp.c @@ -29,7 +29,7 @@ # define LENGTH_LIMIT_EXPR(Expr) 0 #endif -#include +#include #include #define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) diff --git a/lib/version-etc.h b/lib/version-etc.h --- a/lib/version-etc.h +++ b/lib/version-etc.h @@ -1,5 +1,5 @@ /* Utility to help print --version output in a consistent format. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,6 +20,8 @@ #ifndef VERSION_ETC_H # define VERSION_ETC_H 1 +# include + # ifndef PARAMS # if defined PROTOTYPES || (defined __STDC__ && __STDC__) # define PARAMS(Args) Args diff --git a/lib/xalloc.h b/lib/xalloc.h --- a/lib/xalloc.h +++ b/lib/xalloc.h @@ -18,6 +18,8 @@ #ifndef XALLOC_H_ # define XALLOC_H_ +# include + # ifndef PARAMS # if defined PROTOTYPES || (defined __STDC__ && __STDC__) # define PARAMS(Args) Args diff --git a/lib/xmemcoll.h b/lib/xmemcoll.h --- a/lib/xmemcoll.h +++ b/lib/xmemcoll.h @@ -1,2 +1,3 @@ +#include extern int xmemcoll_exit_failure; int xmemcoll (char *, size_t, char *, size_t); diff --git a/m4/ChangeLog b/m4/ChangeLog --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,8 @@ +2003-06-04 Paul Eggert + + * exclude.m4 (gl_EXCLUDE): Don't check for sys/types.h; no loner + needed. + 2003-05-30 Bruno Haible * gettext.m4: Upgrade to gettext-0.12.1. diff --git a/m4/exclude.m4 b/m4/exclude.m4 --- a/m4/exclude.m4 +++ b/m4/exclude.m4 @@ -9,5 +9,5 @@ AC_DEFUN([gl_EXCLUDE], [ dnl Prerequisites of lib/exclude.c. - AC_CHECK_HEADERS_ONCE(stdlib.h string.h strings.h sys/types.h) + AC_CHECK_HEADERS_ONCE(stdlib.h string.h strings.h) ])