changeset 4101:cf248975b9d3

Make getline.h and unicodeio.h self-contained.
author Bruno Haible <bruno@clisp.org>
date Tue, 31 Dec 2002 12:56:28 +0000
parents 6118ace53e83
children 1804d7137fc9
files lib/ChangeLog lib/getline.h lib/unicodeio.c lib/unicodeio.h
diffstat 4 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,10 @@
+2002-12-23  Bruno Haible  <bruno@clisp.org>
+
+	* getline.h: Include <stddef.h>, for size_t.
+
+	* unicodeio.h: Include <stddef.h>, for size_t.
+	* unicodeio.c: Don't include <stddef.h>.
+
 2002-12-17  Bruno Haible  <bruno@clisp.org>
 
 	* canon-host.c (strdup): Remove unused declaration.
--- a/lib/getline.h
+++ b/lib/getline.h
@@ -1,4 +1,4 @@
-/*  Copyright (C) 1995, 1997, 1999 Free Software Foundation, Inc.
+/*  Copyright (C) 1995, 1997, 1999, 2000-2002 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
@@ -17,6 +17,7 @@
 #ifndef GETLINE_H_
 # define GETLINE_H_ 1
 
+# include <stddef.h>
 # include <stdio.h>
 
 # ifndef PARAMS
@@ -27,12 +28,15 @@
 #  endif
 # endif
 
+/* glibc2 has these functions declared in <stdio.h>.  Avoid redeclarations.  */
 # if __GLIBC__ < 2
+
 int
 getline PARAMS ((char **_lineptr, size_t *_n, FILE *_stream));
 
 int
 getdelim PARAMS ((char **_lineptr, size_t *_n, int _delimiter, FILE *_stream));
+
 # endif
 
 #endif /* not GETLINE_H_ */
--- a/lib/unicodeio.c
+++ b/lib/unicodeio.c
@@ -26,9 +26,8 @@
 # include <config.h>
 #endif
 
-#if HAVE_STDDEF_H
-# include <stddef.h>
-#endif
+/* Specification.  */
+#include "unicodeio.h"
 
 #include <stdio.h>
 #if HAVE_STRING_H
@@ -52,9 +51,6 @@
 #define _(msgid) gettext (msgid)
 #define N_(msgid) msgid
 
-/* Specification.  */
-#include "unicodeio.h"
-
 /* When we pass a Unicode character to iconv(), we must pass it in a
    suitable encoding. The standardized Unicode encodings are
    UTF-8, UCS-2, UCS-4, UTF-16, UTF-16BE, UTF-16LE, UTF-7.
--- a/lib/unicodeio.h
+++ b/lib/unicodeio.h
@@ -20,6 +20,7 @@
 #ifndef UNICODEIO_H
 # define UNICODEIO_H
 
+# include <stddef.h>
 # include <stdio.h>
 
 # ifndef PARAMS