bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] dirname.h self-contained?


From: Paul Eggert
Subject: Re: [Bug-gnulib] dirname.h self-contained?
Date: 29 May 2003 10:58:37 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Here's a proposed patch to fix Oskar Liljeblad's original problem,
along with other instances of similar problems that I noticed.

Index: lib/ChangeLog
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/ChangeLog,v
retrieving revision 1.470
diff -p -u -r1.470 ChangeLog
--- lib/ChangeLog       29 May 2003 07:21:59 -0000      1.470
+++ lib/ChangeLog       29 May 2003 17:56:34 -0000
@@ -1,3 +1,16 @@
+2003-05-29  Paul Eggert  <address@hidden>
+
+       * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
+       malloc.c, utenv.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.
+       * linebuffer.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-05-28  Paul Eggert  <address@hidden>
 
        Assume the headers required for C89 freestanding compilers.
Index: lib/__fpending.h
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/__fpending.h,v
retrieving revision 1.3
diff -p -u -r1.3 __fpending.h
--- lib/__fpending.h    28 Aug 2000 14:55:18 -0000      1.3
+++ lib/__fpending.h    29 May 2003 17:56:34 -0000
@@ -2,13 +2,12 @@
 # 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"
Index: lib/addext.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/addext.c,v
retrieving revision 1.10
diff -p -u -r1.10 addext.c
--- lib/addext.c        29 May 2003 07:21:59 -0000      1.10
+++ lib/addext.c        29 May 2003 17:56:34 -0000
@@ -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: lib/backupfile.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/backupfile.c,v
retrieving revision 1.38
diff -p -u -r1.38 backupfile.c
--- lib/backupfile.c    29 May 2003 07:21:59 -0000      1.38
+++ lib/backupfile.c    29 May 2003 17:56:34 -0000
@@ -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: lib/dirname.h
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/dirname.h,v
retrieving revision 1.6
diff -p -u -r1.6 dirname.h
--- lib/dirname.h       12 May 2001 15:46:36 -0000      1.6
+++ lib/dirname.h       29 May 2003 17:56:34 -0000
@@ -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: lib/exclude.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/exclude.c,v
retrieving revision 1.13
diff -p -u -r1.13 exclude.c
--- lib/exclude.c       29 May 2003 07:21:59 -0000      1.13
+++ lib/exclude.c       29 May 2003 17:56:35 -0000
@@ -30,10 +30,8 @@
 #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: lib/getline.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/getline.c,v
retrieving revision 1.11
diff -p -u -r1.11 getline.c
--- lib/getline.c       13 Jan 2003 07:07:30 -0000      1.11
+++ lib/getline.c       29 May 2003 17:56:35 -0000
@@ -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: lib/linebuffer.h
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/linebuffer.h,v
retrieving revision 1.12
diff -p -u -r1.12 linebuffer.h
--- lib/linebuffer.h    13 Jan 2003 07:09:45 -0000      1.12
+++ lib/linebuffer.h    29 May 2003 17:56:35 -0000
@@ -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: lib/malloc.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/malloc.c,v
retrieving revision 1.4
diff -p -u -r1.4 malloc.c
--- lib/malloc.c        7 Aug 2000 15:48:18 -0000       1.4
+++ lib/malloc.c        29 May 2003 17:56:35 -0000
@@ -22,7 +22,7 @@
 #endif
 #undef malloc
 
-#include <sys/types.h>
+#include <stddef.h>
 
 char *malloc ();
 
Index: lib/memcasecmp.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/memcasecmp.c,v
retrieving revision 1.8
diff -p -u -r1.8 memcasecmp.c
--- lib/memcasecmp.c    7 Jan 2000 06:59:36 -0000       1.8
+++ lib/memcasecmp.c    29 May 2003 17:56:35 -0000
@@ -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: lib/memcasecmp.h
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/memcasecmp.h,v
retrieving revision 1.5
diff -p -u -r1.5 memcasecmp.h
--- lib/memcasecmp.h    16 Jan 1998 08:51:51 -0000      1.5
+++ lib/memcasecmp.h    29 May 2003 17:56:35 -0000
@@ -1,3 +1,5 @@
+#include <stddef.h>
+
 #ifndef PARAMS
 # if defined PROTOTYPES || (defined __STDC__ && __STDC__)
 #  define PARAMS(Args) Args
Index: lib/memcoll.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/memcoll.c,v
retrieving revision 1.8
diff -p -u -r1.8 memcoll.c
--- lib/memcoll.c       31 Dec 2002 22:11:34 -0000      1.8
+++ lib/memcoll.c       29 May 2003 17:56:35 -0000
@@ -21,12 +21,12 @@
 # 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>
Index: lib/memcoll.h
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/memcoll.h,v
retrieving revision 1.1
diff -p -u -r1.1 memcoll.h
--- lib/memcoll.h       4 Jul 1999 10:38:43 -0000       1.1
+++ lib/memcoll.h       29 May 2003 17:56:35 -0000
@@ -5,6 +5,8 @@
 #  include <config.h>
 # endif
 
+# include <stddef.h>
+
 # ifndef PARAMS
 #  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
 #   define PARAMS(Args) Args
Index: lib/putenv.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/putenv.c,v
retrieving revision 1.23
diff -p -u -r1.23 putenv.c
--- lib/putenv.c        7 Apr 2000 09:24:18 -0000       1.23
+++ lib/putenv.c        29 May 2003 17:56:36 -0000
@@ -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: lib/realloc.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/realloc.c,v
retrieving revision 1.6
diff -p -u -r1.6 realloc.c
--- lib/realloc.c       7 Aug 2000 15:48:18 -0000       1.6
+++ lib/realloc.c       29 May 2003 17:56:36 -0000
@@ -22,7 +22,7 @@
 #endif
 #undef realloc
 
-#include <sys/types.h>
+#include <stddef.h>
 
 char *malloc ();
 char *realloc ();
Index: lib/strcasecmp.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/strcasecmp.c,v
retrieving revision 1.4
diff -p -u -r1.4 strcasecmp.c
--- lib/strcasecmp.c    7 Aug 2000 15:48:18 -0000       1.4
+++ lib/strcasecmp.c    29 May 2003 17:56:36 -0000
@@ -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: lib/xalloc.h
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/xalloc.h,v
retrieving revision 1.13
diff -p -u -r1.13 xalloc.h
--- lib/xalloc.h        31 Oct 2000 07:09:56 -0000      1.13
+++ lib/xalloc.h        29 May 2003 17:56:36 -0000
@@ -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: lib/xmemcoll.h
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/xmemcoll.h,v
retrieving revision 1.1
diff -p -u -r1.1 xmemcoll.h
--- lib/xmemcoll.h      22 Jan 2002 08:03:03 -0000      1.1
+++ lib/xmemcoll.h      29 May 2003 17:56:36 -0000
@@ -1,2 +1,3 @@
+#include <stddef.h>
 extern int xmemcoll_exit_failure;
 int xmemcoll (char *, size_t, char *, size_t);
Index: m4/ChangeLog
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/ChangeLog,v
retrieving revision 1.449
diff -p -u -r1.449 ChangeLog
--- m4/ChangeLog        29 May 2003 07:21:59 -0000      1.449
+++ m4/ChangeLog        29 May 2003 17:56:40 -0000
@@ -1,3 +1,8 @@
+2003-05-29  Paul Eggert  <address@hidden>
+
+       * exclude.m4 (gl_EXCLUDE): Don't check for sys/types.h; no loner
+       needed.
+
 2003-05-28  Paul Eggert  <address@hidden>
 
        Assume the headers required for C89 freestanding compilers.
Index: m4/exclude.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/exclude.m4,v
retrieving revision 1.1
diff -p -u -r1.1 exclude.m4
--- m4/exclude.m4       31 Dec 2002 13:42:06 -0000      1.1
+++ m4/exclude.m4       29 May 2003 17:56:41 -0000
@@ -9,5 +9,5 @@ dnl the same distribution terms as the r
 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)
 ])




reply via email to

[Prev in Thread] Current Thread [Next in Thread]