From: Bruno Haible Date: Thu, 7 Jan 2010 22:12:26 +0000 (+0100) Subject: stdio: Ensure defines off_t, ssize_t, va_list. X-Git-Tag: v0.1~4887 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=f1195ccd1ee2cd56ed6b82a76fdee8de0c3d78b7;p=gnulib.git stdio: Ensure defines off_t, ssize_t, va_list. --- diff --git a/ChangeLog b/ChangeLog index 750b35bd8..41fb383ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2010-01-07 Bruno Haible + stdio: Ensure defines off_t, ssize_t, va_list. + * lib/stdio.in.h: Include 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 + xlist, xoset: Fix missing dependency bug, introduced on 2009-12-13. * modules/xlist (Depends-on): Add 'list', * modules/xoset (Depends-on): Add 'oset'. diff --git a/doc/posix-headers/stdio.texi b/doc/posix-headers/stdio.texi index 1135791ff..ee094f395 100644 --- a/doc/posix-headers/stdio.texi +++ b/doc/posix-headers/stdio.texi @@ -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 diff --git a/lib/stdio.in.h b/lib/stdio.in.h index 1fc4f30ed..9e1fac38e 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -36,14 +36,13 @@ #ifndef _GL_STDIO_H #define _GL_STDIO_H +/* Get va_list. Needed on many systems, including glibc 2.8. */ #include + #include -#if (@GNULIB_FSEEKO@ || @GNULIB_FTELLO@ || @GNULIB_GETDELIM@ \ - || @GNULIB_GETLINE@ || defined GNULIB_POSIXCHECK) -/* Get off_t and ssize_t. */ -# include -#endif +/* Get off_t and ssize_t. Needed on many systems, including glibc 2.8. */ +#include #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ diff --git a/tests/test-stdio.c b/tests/test-stdio.c index 917dbc81a..87100576f 100644 --- a/tests/test-stdio.c +++ b/tests/test-stdio.c @@ -1,5 +1,5 @@ /* Test of substitute. - Copyright (C) 2007, 2009, 2010 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) {