From: Eric Blake Date: Tue, 17 Apr 2007 03:38:08 +0000 (+0000) Subject: Make fflush rely on fpurge. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f2eba1862c526737baf2dfe605bf5257133adeb;p=pspp Make fflush rely on fpurge. * lib/fflush.c (rpl_fflush): Rely on fpurge module, rather than open coding all variants. * modules/fflush (Depends-on): Add fpurge and unistd. * modules/fflush-tests (Depends-on): Unistd is no longer extra. * m4/fflush.m4 (gl_REPLACE_FFLUSH): Simplify. --- diff --git a/m4/fflush.m4 b/m4/fflush.m4 index a9889d47e9..161680f2ce 100755 --- a/m4/fflush.m4 +++ b/m4/fflush.m4 @@ -8,8 +8,7 @@ dnl From Eric Blake dnl Find out how to obey POSIX semantics of fflush(stdin) discarding -dnl unread input, rather than C99 undefined semantics. fpurge is not -dnl standardized, but has the desired properties. +dnl unread input on seekable streams, rather than C99 undefined semantics. AC_DEFUN([gl_FUNC_FFLUSH], [ @@ -45,15 +44,6 @@ AC_DEFUN([gl_FUNC_FFLUSH], AC_DEFUN([gl_REPLACE_FFLUSH], [ - AC_CHECK_HEADERS_ONCE([stdio_ext.h]) - AC_CHECK_FUNCS_ONCE([fpurge __fpurge]) -dnl Linux documents int fpurge(), but only declares void __fpurge(). - AC_CHECK_DECLS([fpurge], [], [], [[ -#include -#if HAVE_STDIO_EXT_H -# include -#endif -]]) AC_LIBOBJ([fflush]) AC_REQUIRE([gl_STDIO_H_DEFAULTS]) REPLACE_FFLUSH=1