This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PATCH std stdio for (Free)BSD
authorNicholas Clark <nick@ccl4.org>
Wed, 8 Nov 2000 15:36:29 +0000 (15:36 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 8 Nov 2000 16:58:26 +0000 (16:58 +0000)
Message-ID: <20001108153629.D98736@plum.flirble.org>

p4raw-id: //depot/metaconfig@7607

U/compline/d_stdstdio.U

index acf01b4..04221c6 100644 (file)
 ?F:!try
 : see if _ptr and _cnt from stdio act std
 echo " "
-if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
+
+if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
+       echo "(Looks like you have stdio.h from BSD.)"
+       case "$stdio_ptr" in
+       '') stdio_ptr='((fp)->_p)'
+               ptr_lval=$define
+               ;;
+       *)      ptr_lval=$d_stdio_ptr_lval;;
+       esac
+       case "$stdio_cnt" in
+       '') stdio_cnt='((fp)->_r)'
+               cnt_lval=$define
+               ;;
+       *)      cnt_lval=$d_stdio_cnt_lval;;
+       esac
+       case "$stdio_base" in
+       '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
+       esac
+       case "$stdio_bufsiz" in
+       '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
+       esac
+elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
        echo "(Looks like you have stdio.h from Linux.)"
        case "$stdio_ptr" in
        '') stdio_ptr='((fp)->_IO_read_ptr)'
@@ -211,6 +232,7 @@ else
        '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
        esac
 fi
+
 : test whether _ptr and _cnt really work
 echo "Checking how std your stdio is..." >&4
 $cat >try.c <<EOP