changeset 8707:04725e6593af

fflush & GNULIB_POSIXCHECK.
author Bruno Haible <bruno@clisp.org>
date Wed, 25 Apr 2007 07:09:29 +0000
parents 6241ddf70c2e
children 53c8c606b9b7
files ChangeLog lib/stdio_.h
diffstat 2 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-04-25  Bruno Haible  <bruno@clisp.org>
+
+	* lib/stdio_.h (fflush): Add support for GNULIB_POSIXCHECK.
+
 2007-04-25  Bruno Haible  <bruno@clisp.org>
 
 	* lib/unistd_.h: Include <stdio.h> if needed to get the SEEK_* macros.
--- a/lib/stdio_.h
+++ b/lib/stdio_.h
@@ -207,11 +207,20 @@
 # 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