From: Bruno Haible Date: Wed, 25 Apr 2007 07:09:29 +0000 (+0000) Subject: fflush & GNULIB_POSIXCHECK. X-Git-Tag: cvs-readonly~511 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=b043f8b380f24e6cc52e7864c140765566068c2b;p=gnulib.git fflush & GNULIB_POSIXCHECK. --- diff --git a/ChangeLog b/ChangeLog index 33c7d57fd..bf3901e4e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-04-25 Bruno Haible + * lib/stdio_.h (fflush): Add support for GNULIB_POSIXCHECK. + +2007-04-25 Bruno Haible + * lib/unistd_.h: Include if needed to get the SEEK_* macros. * tests/test-stdio.c: Check that the various SEEK_* macros are defined. * tests/test-unistd.c: Likewise. diff --git a/lib/stdio_.h b/lib/stdio_.h index a87bf8da7..2a5a253c6 100644 --- a/lib/stdio_.h +++ b/lib/stdio_.h @@ -207,11 +207,20 @@ extern int vsprintf (char *str, const char *format, va_list args) # endif #endif -#if @GNULIB_FFLUSH@ && @REPLACE_FFLUSH@ -# define fflush rpl_fflush +#if @GNULIB_FFLUSH@ +# if @REPLACE_FFLUSH@ +# define fflush rpl_fflush /* Flush all pending data on STREAM according to POSIX rules. Both output and seekable input streams are supported. */ extern int fflush (FILE *gl_stream); +# endif +#elif defined GNULIB_POSIXCHECK +# undef fflush +# define fflush(f) \ + (GL_LINK_WARNING ("fflush is not always POSIX compliant - " \ + "use gnulib module fflush for portable " \ + "POSIX compliance"), \ + fflush (f)) #endif #ifdef __cplusplus