.h files should stand alone, but we shouldn't include <sys/types.h>
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 4 Jun 2003 19:22:29 +0000 (19:22 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 4 Jun 2003 19:22:29 +0000 (19:22 +0000)
if we can get away with just <stddef.h>.

24 files changed:
lib/ChangeLog
lib/__fpending.h
lib/addext.c
lib/backupfile.c
lib/dirname.h
lib/exclude.c
lib/getline.c
lib/hash.h
lib/linebuffer.h
lib/malloc.c
lib/memcasecmp.c
lib/memcasecmp.h
lib/memcoll.c
lib/memcoll.h
lib/putenv.c
lib/readtokens.h
lib/realloc.c
lib/stdio-safer.h
lib/strcasecmp.c
lib/version-etc.h
lib/xalloc.h
lib/xmemcoll.h
m4/ChangeLog
m4/exclude.m4

index 873bd9c3d8be8a3ff4b1e7a983d2e24d107e79be..21b402ffa4e082953ec2f5481850f3c4caad4d8b 100644 (file)
@@ -1,4 +1,21 @@
-2002-08-05  Paul Eggert  <eggert@twinsun.com>
+2003-06-04  Paul Eggert  <eggert@twinsun.com>
+
+       .h files should stand alone, but we shouldn't include <sys/types.h>
+       if we can get away with just <stddef.h>.
+
+       * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
+       malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
+       rather than <sys/types.h>, as we merely need size_t.
+       * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
+       to get size_t.
+       * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
+       Include <stdio.h>, to get FILE.
+       * memcasecmp.c: Don't include <sys/types.h>, as we can assume
+       memcasecmp.h has included <stddef.h> and all we need is size_t.
+       * memcoll.c: Include "memcoll.h", which gets us size_t and checks
+       our interface, instead of including <sys/types.h>
+
+2003-06-02  Paul Eggert  <eggert@twinsun.com>
 
        [from coreutils]
        Fix some minor time-related bugs with POSIX time arguments.
index a59bc58d50b40e13b0f39aa793f4c9da607ace51..5a5158216c1a1261629ae8bbaa54b68a30fc803a 100644 (file)
@@ -2,14 +2,13 @@
 # include <config.h>
 #endif
 
+#include <stddef.h>
 #include <stdio.h>
 
 #if HAVE_STDIO_EXT_H
 # include <stdio_ext.h>
 #endif
 
-#include <sys/types.h>
-
 #ifndef HAVE_DECL___FPENDING
 "this configure-time declaration test was not run"
 #endif
index 283756bf4316afa4178c1c3ca390aa884b1b8e59..7753c608aa350b2e70bee07e2924dfde63363d0d 100644 (file)
@@ -36,7 +36,7 @@
 # define _POSIX_NAME_MAX 14
 #endif
 
-#include <sys/types.h>
+#include <stddef.h>
 #if HAVE_STRING_H
 # include <string.h>
 #else
index 0dfa02eace213c3d9b1553675d284521262a22ac..d78ce3945fe2e170b374daf1f4590a0def24c7f1 100644 (file)
@@ -25,8 +25,8 @@
 # include <config.h>
 #endif
 
+#include <stddef.h>
 #include <stdio.h>
-#include <sys/types.h>
 #if HAVE_STRING_H
 # include <string.h>
 #else
index cea14c04ff479f51bc7635a847e476b0ec118fcc..4f794ee4840aff2ee4d577fa06e05dcb7b097b30 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef DIRNAME_H_
 # define DIRNAME_H_ 1
 
+# include <stddef.h>
+
 # ifndef PARAMS
 #  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
 #   define PARAMS(Args) Args
index 9f2970f4b70cd7abedd7aa1def36139fc8cc2a95..fb735ee6e4f5ff17a45e1291518c7ea2b9af3c78 100644 (file)
 #ifndef errno
 extern int errno;
 #endif
+#include <stddef.h>
 #include <stdio.h>
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
 #if HAVE_STDLIB_H
 # include <stdlib.h>
 #endif
index 18383b12c6261dd9b286b7470eed8f596b2c546c..f4edecc8aae261e9e2ffdc1bbe78352c5e510bc8 100644 (file)
@@ -31,8 +31,8 @@
 # define _GNU_SOURCE 1
 #endif
 
+#include <stddef.h>
 #include <stdio.h>
-#include <sys/types.h>
 
 #if defined __GNU_LIBRARY__ && HAVE_GETDELIM
 
index a9fc187606a82d5ca1079772ed0e207de27f429f..b5537fa8dbb61ca3de3149dc13c532e177b20bed 100644 (file)
@@ -24,6 +24,8 @@
 #ifndef HASH_H_
 # define HASH_H_
 
+# include <stdio.h>
+
 # ifndef PARAMS
 #  if PROTOTYPES || __STDC__
 #   define PARAMS(Args) Args
index aa6db0e3fd7362d5254a19dfc22bf11521442f9c..b91bf7813f6eefaed53ee732ac3a53a3cc9ae644 100644 (file)
@@ -20,6 +20,8 @@
 #if !defined LINEBUFFER_H
 # define LINEBUFFER_H
 
+# include <stdio.h>
+
 /* A `struct linebuffer' holds a line of text. */
 
 struct linebuffer
index 5e7674bd47d541f17348164f049d3122f17f1ea9..bcd6b564b07abf5d41a5d1faeca6ecb3aa6e29ae 100644 (file)
@@ -22,7 +22,7 @@
 #endif
 #undef malloc
 
-#include <sys/types.h>
+#include <stddef.h>
 
 char *malloc ();
 
index 18dd31f6e496d35579a0ebdf85f0f6deb78ca909..3b2d838984f947816f8ce43808a4df4237617d57 100644 (file)
@@ -21,7 +21,6 @@
 # include <config.h>
 #endif
 
-#include <sys/types.h>
 #include <ctype.h>
 
 #if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
index 164dff435b8785f1c0ddf1b15b818305f02724b7..61c39aa73f9de214928db6dafd12fa0eefb5409b 100644 (file)
@@ -1,3 +1,5 @@
+#include <stddef.h>
+
 #ifndef PARAMS
 # if defined PROTOTYPES || (defined __STDC__ && __STDC__)
 #  define PARAMS(Args) Args
index 49eccdad29ec5138a2177c02c72cef0193306af3..2bb33fdfc5cf67e722eca2a80977d8052b2fafb6 100644 (file)
 # include <config.h>
 #endif
 
+#include "memcoll.h"
+
 #include <errno.h>
 #ifndef errno
 extern int errno;
 #endif
 
-#include <sys/types.h>
-
 #if HAVE_STRING_H
 # include <string.h>
 #endif
index 4909bddff0763412c62ddbb5b1ce93a336e50365..b42cfa6f264cb68452fea854067c0b1a60a9000a 100644 (file)
@@ -5,6 +5,8 @@
 #  include <config.h>
 # endif
 
+# include <stddef.h>
+
 # ifndef PARAMS
 #  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
 #   define PARAMS(Args) Args
index 58a498fdaa478994071938fb5765c9e2e503e358..239981f07b0e9bd3249501a491375bf215e86e6e 100644 (file)
@@ -21,7 +21,7 @@
 # include <config.h>
 #endif
 
-#include <sys/types.h>
+#include <stddef.h>
 
 /* Include errno.h *after* sys/types.h to work around header problems
    on AIX 3.2.5.  */
index a2e0b9d73aca86e1070ae8b8bd774b39861f217e..0fb8b463bb9ae82b680e859b8cadcf0c8500b044 100644 (file)
@@ -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 <stdio.h>
+
 # ifndef INITIAL_TOKEN_LENGTH
 #  define INITIAL_TOKEN_LENGTH 20
 # endif
index d0d3e4ab07c242e9ca96710be79c703bd181895b..5c94a0a25c67af5a461db5274291b4204495aa3b 100644 (file)
@@ -22,7 +22,7 @@
 #endif
 #undef realloc
 
-#include <sys/types.h>
+#include <stddef.h>
 
 char *malloc ();
 char *realloc ();
index bd5cbd8da8a92def9f16e673936d312e841dabeb..20fabd3efe331bf4f8ed3ff8d80274b9be6a8a17 100644 (file)
@@ -1,3 +1,5 @@
+#include <stdio.h>
+
 #ifndef PARAMS
 # if defined PROTOTYPES || (defined __STDC__ && __STDC__)
 #  define PARAMS(Args) Args
index ae7601de0fcf9d6d3d1ad547705ec769c1ba6b93..cf4ab88dbdf04448b73d8507f1cbe142d15f67e8 100644 (file)
@@ -29,7 +29,7 @@
 # define LENGTH_LIMIT_EXPR(Expr) 0
 #endif
 
-#include <sys/types.h>
+#include <stddef.h>
 #include <ctype.h>
 
 #define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
index ae223d44e5a46b6ef2528a6303b77072cb371aa4..4b1a7d9c8a175d95ab76a3b83fb67a24ca1e3256 100644 (file)
@@ -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 <stdio.h>
+
 # ifndef PARAMS
 #  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
 #   define PARAMS(Args) Args
index 098a6c2e0730aaccda487400d1d51893257452f2..5b623da2039b29096b4d05094940b8052b453460 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef XALLOC_H_
 # define XALLOC_H_
 
+# include <stddef.h>
+
 # ifndef PARAMS
 #  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
 #   define PARAMS(Args) Args
index dfda0fce98cc91915fb528f917be42cb4c91b273..1b1a193ee663ffb4bdecd9ee10aac9fe79296b1a 100644 (file)
@@ -1,2 +1,3 @@
+#include <stddef.h>
 extern int xmemcoll_exit_failure;
 int xmemcoll (char *, size_t, char *, size_t);
index 572eca7ee3fa281f6734a3614729d3d9f74f6e23..6c397347de44d2cc00f39ae35d751d7f4b279066 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-04  Paul Eggert  <eggert@twinsun.com>
+
+       * exclude.m4 (gl_EXCLUDE): Don't check for sys/types.h; no loner
+       needed.
+
 2003-05-30  Bruno Haible  <bruno@clisp.org>
 
        * gettext.m4: Upgrade to gettext-0.12.1.
index 4ec93de6401394881c89d4d6732b1da95ffe912a..0501fc4269de092a2a22f4054ce835ee6150a30c 100644 (file)
@@ -9,5 +9,5 @@ dnl the same distribution terms as the rest of that program.
 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)
 ])