From ed39a0f293e2ca19ac172fe487c41b770b86d94d Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Fri, 14 May 1999 07:33:26 +0000 Subject: [PATCH] Still fflushing. p4raw-id: //depot/cfgperl@3420 --- Configure | 95 +++++++++++++++++++++++++++++++++---------------------------- config_h.SH | 9 ++++-- util.c | 2 +- 3 files changed, 59 insertions(+), 47 deletions(-) diff --git a/Configure b/Configure index 2735828..4a78ff7 100755 --- a/Configure +++ b/Configure @@ -20,7 +20,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Fri May 14 00:11:18 EET DST 1999 [metaconfig 3.0 PL70] +# Generated on Fri May 14 10:24:50 EET DST 1999 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.com) cat >/tmp/c1$$ <&4 <try.c < +int main() { + if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin) + printf("yes\n"); +} +EOCP + for s in _iob __iob __sF + do + set try -DSTDIO_STREAM_ARRAY=$s + if eval $compile; then + case "`./try$exe_ext`" in + yes) stdio_stream_array=$s; break ;; + esac + fi + done + $rm -f try.* try$exe_ext +esac +case "$stdio_stream_array" in +'') $cat >&4 <&4 <&4 <try.c < -int main() { - if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin) - printf("yes\n"); -} -EOCP - for s in _iob __iob __sF - do - set try -DSTDIO_STREAM_ARRAY=$s - if eval $compile_ok; then - case "`./try$exe_ext`" in - yes) stdio_stream_array=$s; break ;; - esac - fi - done - $rm -f try.* try$exe_ext -esac -case "$stdio_stream_array" in -'') $cat >&4 <&4 < which we generally avoid, but need for this test. # For everyone else, we'll trust i_unistd. t_unistd=$i_unistd @@ -10975,6 +10978,7 @@ $cat >try.c < #endif #$d_sysconf HAS_SYSCONF +#$stdio_stream_array int main() { FILE* p = fopen("try.out", "w"); #ifdef TRY_FPUTC @@ -11005,12 +11009,14 @@ int main() { # endif # endif # endif +# ifdef HAS_STDIO_STREAM_ARRAY if (open_max > 0) { long i; for (i = 0; i < open_max; i++) fflush(&$stdio_stream_array[i]); } } +# endif #endif _exit(42); } @@ -11054,26 +11060,26 @@ case "$fflushNULL" in x) $cat >&4 <&4 <&4 <&4 <&4 <&4 <config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un- #$d_ftello64 HAS_FTELLO64 /**/ #$d_tmpfile64 HAS_TMPFILE64 /**/ +/* HAS_STDIO_STREAM_ARRAY: + * This symbol, if defined, tells that there is an array + * holding the stdio streams. + */ /* STDIO_STREAM_ARRAY: - * This symbol tells the name of the array holding the stdio stream_array, - * if any. Usual values include _iob, __iob, and __sF. + * This symbol tells the name of the array holding the stdio streams. + * Usual values include _iob, __iob, and __sF. */ +#$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY /**/ #define STDIO_STREAM_ARRAY $stdio_stream_array /* USE_64_BITS: diff --git a/util.c b/util.c index 79b9f49..a60c8fc 100644 --- a/util.c +++ b/util.c @@ -3202,7 +3202,7 @@ my_fflush_all(void) return fflush(NULL); #else long open_max = -1; -# if defined(FFLUSH_ALL) && defined(STDIO_STREAM_ARRAY) +# if defined(FFLUSH_ALL) && defined(HAS_STDIO_STREAM_ARRAY) # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX) open_max = sysconf(_SC_OPEN_MAX); # else -- 2.7.4