fflush.
authorJarkko Hietaniemi <jhi@iki.fi>
Fri, 21 May 1999 21:59:46 +0000 (21:59 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Fri, 21 May 1999 21:59:46 +0000 (21:59 +0000)
p4raw-id: //depot/cfgperl@3442

Configure
Porting/Glossary
Porting/config.sh
Porting/config_H
config_h.SH

index eb93907..83e41da 100755 (executable)
--- 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 Thu May 20 10:07:46 EET DST 1999 [metaconfig 3.0 PL70]
+# Generated on Sat May 22 00:54:37 EET DST 1999 [metaconfig 3.0 PL70]
 # (with additional metaconfig patches by perlbug@perl.com)
 
 cat >/tmp/c1$$ <<EOF
@@ -10975,7 +10975,7 @@ $cat >try.c <<EOCP
 #include <stdio.h>
 #$t_unistd I_UNISTD
 #ifdef I_UNISTD
-#include <unistd.h>
+# include <unistd.h>
 #endif
 #$d_sysconf HAS_SYSCONF
 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
@@ -11053,12 +11053,16 @@ case "$fflushNULL" in
 '')    set try -DTRY_FFLUSH_NULL $output
        $rm -f try.out
        if eval $compile; then
-               $cat >&4 <<EOM
-(This test may fail, saying "Core dumped" or something equally evil.)
-EOM
                ./try$exe_ext 2>/dev/null
-               if $test -s try.out -a "X$?" = X42; then
+               code="$?"
+               if $test -s try.out -a "X$code" = X42; then
                        fflushNULL="`$cat try.out`"
+               else
+                       if $test "X$code" != X42; then
+                               $cat >&4 <<EOM
+(If this test failed, don't worry, we'll try another method shortly.)
+EOM
+                       fi
                fi
        fi
        $rm -f core try.core core.try.*
@@ -11088,51 +11092,51 @@ $define|true|[yY]*)
        fflushNULL="$undef"
        ;;
 esac
-: check for fflush all behaviour
-case "$fflushall" in
-'')    set try -DTRY_FFLUSH_ALL $output
-       $rm -f try.out
-       if eval $compile; then
+: check explicit looping only if NULL did not work
+case "$fflushNULL" in
+"$undef")
+       : check for fflush all behaviour
+       case "$fflushall" in
+       '')     set try -DTRY_FFLUSH_ALL $output
+               $rm -f try.out
+               if eval $compile; then
                $cat >&4 <<EOM
-(Also this test may fail.)
+(Now testing the other method--but note that also this may fail.)
 EOM
-               ./try$exe_ext 2>/dev/null
-               if $test -s try.out -a "X$?" = X42; then
-                       fflushall="`$cat try.out`"
+                       ./try$exe_ext 2>/dev/null
+                       if $test -s try.out -a "X$?" = X42; then
+                               fflushall="`$cat try.out`"
+                       fi
                fi
-       fi
-       $rm -f core try.core core.try.*
-       case "$fflushall" in
-       x)      $cat >&4 <<EOM
-Flushing explicitly all the stdio streams works.
+               $rm -f core try.core core.try.*
+               case "$fflushall" in
+               x)      $cat >&4 <<EOM
+Whew. Flushing explicitly all the stdio streams works.
 EOM
-               fflushall="$define"
-               ;;
-       '')     $cat >&4 <<EOM
-Flushing explicitly all the stdio streams doesn't work.
+                       fflushall="$define"
+                       ;;
+               '')     $cat >&4 <<EOM
+Sigh. Flushing explicitly all the stdio streams doesn't work.
 EOM
-               fflushall="$undef"
-               ;;
-       *)      $cat >&4 <<EOM
+                       fflushall="$undef"
+                       ;;
+               *)      $cat >&4 <<EOM
 Cannot figure out whether flushing stdio streams explicitly works or not.
 I'm assuming it doesn't.
 EOM
-               fflushall="$undef"
+                       fflushall="$undef"
+                       ;;
+               esac
                ;;
-       esac
-       case "$fflushall$fflushNULL" in
-       undefdefine)
-                $cat >&4 <<EOM
-(That's ok.  I'll use fflush(NULL) instead.)
-EOM
+       "$define"|true|[yY]*)
+               fflushall="$define"
+               ;;
+       *)
+               fflushall="$undef"
                ;;
        esac
        ;;
-$define|true|[yY]*)
-       fflushall="$define"
-       ;;
-*)
-       fflushall="$undef"
+*)     fflushall="$undef"      
        ;;
 esac
 case "$fflushNULL$fflushall" in
index 070027b..8256ea8 100644 (file)
@@ -1659,6 +1659,8 @@ fflushall (fflushall.U):
        This symbol, if defined, tells that to flush
        all pending stdio output one must loop through all
        the stdio file handles stored in an array and fflush them.
+       Note that if fflushNULL is defined, fflushall will not
+       even be probed for and will be left undefined.
 
 fflushNULL (fflushall.U):
        This symbol, if defined, tells that fflush(NULL) does flush
index fc3bacf..f9e9447 100644 (file)
@@ -8,7 +8,7 @@
 
 # Package name      : perl5
 # Source directory  : .
-# Configuration time: Thu May 20 09:56:03 EET DST 1999
+# Configuration time: Sat May 22 00:43:12 EET DST 1999
 # Configured by     : jhi
 # Target system     : osf1 alpha.hut.fi v4.0 878 alpha 
 
@@ -55,7 +55,7 @@ ccflags='-pthread -std -DLANGUAGE_C'
 ccsymbols='__LANGUAGE_C__=1 _LONGLONG=1 LANGUAGE_C=1 SYSTYPE_BSD=1'
 cf_by='jhi'
 cf_email='yourname@yourhost.yourplace.com'
-cf_time='Thu May 20 09:56:03 EET DST 1999'
+cf_time='Sat May 22 00:43:12 EET DST 1999'
 chgrp=''
 chmod=''
 chown=''
index 135308a..e215393 100644 (file)
@@ -17,7 +17,7 @@
 /*
  * Package name      : perl5
  * Source directory  : .
- * Configuration time: Thu May 20 09:56:03 EET DST 1999
+ * Configuration time: Sat May 22 00:43:12 EET DST 1999
  * Configured by     : jhi
  * Target system     : osf1 alpha.hut.fi v4.0 878 alpha 
  */
  *     This symbol, if defined, tells that to flush
  *     all pending stdio output one must loop through all
  *     the stdio file handles stored in an array and fflush them.
+ *     Note that if fflushNULL is defined, fflushall will not
+ *     even be probed for and will be left undefined.
  */
 #define        FFLUSH_NULL             /**/
 /*#define      FFLUSH_ALL              / **/
index ae4ba19..97f084e 100644 (file)
@@ -2227,6 +2227,8 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
  *     This symbol, if defined, tells that to flush
  *     all pending stdio output one must loop through all
  *     the stdio file handles stored in an array and fflush them.
+ *     Note that if fflushNULL is defined, fflushall will not
+ *     even be probed for and will be left undefined.
  */
 #$fflushNULL   FFLUSH_NULL             /**/
 #$fflushall    FFLUSH_ALL              /**/