stdio: Ensure <stdio.h> defines off_t, ssize_t, va_list.
authorBruno Haible <bruno@clisp.org>
Thu, 7 Jan 2010 22:12:26 +0000 (23:12 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 7 Jan 2010 22:12:26 +0000 (23:12 +0100)
ChangeLog
doc/posix-headers/stdio.texi
lib/stdio.in.h
tests/test-stdio.c

index 750b35bd8d29a957636127e22bf318107b9f5bf8..41fb383cee5f321bce3acd27c693c65304b992fc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-01-07  Bruno Haible  <bruno@clisp.org>
+
+       stdio: Ensure <stdio.h> defines off_t, ssize_t, va_list.
+       * lib/stdio.in.h: Include <sys/types.h> unconditionally.
+       * tests/test-stdio.c: Verify that fpos_t, off_t, size_t, ssize_t,
+       va_list are defined.
+       * doc/posix-headers/stdio.texi: Document the bug of missing types.
+       Reported by Eric Blake.
+
 2010-01-07  Bruno Haible  <bruno@clisp.org>
 
        xlist, xoset: Fix missing dependency bug, introduced on 2009-12-13.
index 1135791ff74851235465023a14866025886a90ff..ee094f395bcad9e6bbb3ef804993b31c59cb17d9 100644 (file)
@@ -8,6 +8,15 @@ Gnulib module: stdio
 Portability problems fixed by Gnulib:
 @itemize
 @item
+The type @code{off_t} is missing on some platforms:
+glibc 2.8 and others.
+@item
+The type @code{ssize_t} is missing on some platforms:
+glibc 2.8, MacOS X 10.5, Solaris 10, and others.
+@item
+The type @code{va_list} is missing on some platforms:
+glibc 2.8, OpenBSD 4.0, Solaris 10, and others.
+@item
 Some platforms provide a @code{NULL} macro that cannot be used in arbitrary
 expressions:
 NetBSD 5.0
index 1fc4f30edc65a95a8ea1cbcb8061cb068348bdab..9e1fac38efae6b7c6dabfdb364e814d53a0bcb1b 100644 (file)
 #ifndef _GL_STDIO_H
 #define _GL_STDIO_H
 
+/* Get va_list.  Needed on many systems, including glibc 2.8.  */
 #include <stdarg.h>
+
 #include <stddef.h>
 
-#if (@GNULIB_FSEEKO@ || @GNULIB_FTELLO@ || @GNULIB_GETDELIM@ \
-     || @GNULIB_GETLINE@ || defined GNULIB_POSIXCHECK)
-/* Get off_t and ssize_t.  */
-# include <sys/types.h>
-#endif
+/* Get off_t and ssize_t.  Needed on many systems, including glibc 2.8.  */
+#include <sys/types.h>
 
 #ifndef __attribute__
 /* This feature is available in gcc versions 2.5 and later.  */
index 917dbc81adf23ccb0d62d31a2c4ce5c59edd1850..87100576f0769b469e7c5eb4d48709995380eb9a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdio.h> substitute.
-   Copyright (C) 2007, 20092010 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2010 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
@@ -29,6 +29,13 @@ int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
    per POSIX 2008.  */
 verify (sizeof NULL == sizeof (void *));
 
+/* Check that the types are all defined.  */
+fpos_t t1;
+off_t t2;
+size_t t3;
+ssize_t t4;
+va_list t5;
+
 int
 main (void)
 {