-?MAKE:d_ttyname_r ttyname_r_proto: Inlibc Protochk i_systypes i_unistd
+?RCS: $Id: d_ttyname_r.U,v 0RCS:
+?RCS: Copyright (c) 2002,2003 Jarkko Hietaniemi
+?RCS:
+?RCS: You may distribute under the terms of either the GNU General Public
+?RCS: License or the Artistic License, as specified in the README file.
+?RCS:
+?RCS: Generated by the reentr.pl from the Perl 5.8 distribution.
+?RCS:
+?MAKE:d_ttyname_r ttyname_r_proto: Inlibc Protochk Hasproto i_systypes usethreads i_unistd
?MAKE: -pick add $@ %<
?S:d_ttyname_r:
?S: This variable conditionally defines the HAS_TTYNAME_R symbol,
?S:.
?S:ttyname_r_proto:
?S: This variable encodes the prototype of ttyname_r.
+?S: It is zero if d_ttyname_r is undef, and one of the
+?S: REENTRANT_PROTO_T_ABC macros of reentr.h if d_ttyname_r
+?S: is defined.
?S:.
?C:HAS_TTYNAME_R:
?C: This symbol, if defined, indicates that the ttyname_r routine
?C:.
?C:TTYNAME_R_PROTO:
?C: This symbol encodes the prototype of ttyname_r.
+?C: It is zero if d_ttyname_r is undef, and one of the
+?C: REENTRANT_PROTO_T_ABC macros of reentr.h if d_ttyname_r
+?C: is defined.
?C:.
?H:#$d_ttyname_r HAS_TTYNAME_R /**/
?H:#define TTYNAME_R_PROTO $ttyname_r_proto /**/
?H:.
-?T:try hdrs
-?LINT:set d_ttyname_r
-?LINT:set ttyname_r_proto
+?T:try hdrs d_ttyname_r_proto
: see if ttyname_r exists
set ttyname_r d_ttyname_r
eval $inlibc
case "$d_ttyname_r" in
"$define")
- hdrs="$i_systypes sys/types.h $i_unistd unistd.h"
+ hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
+ case "$d_ttyname_r_proto:$usethreads" in
+ ":define") d_ttyname_r_proto=define
+ set d_ttyname_r_proto ttyname_r $hdrs
+ eval $hasproto ;;
+ *) ;;
+ esac
+ case "$d_ttyname_r_proto" in
+ define)
case "$ttyname_r_proto" in
- '') try='extern int ttyname_r(int, char*, size_t);'
- ./protochk "$try" $hdrs && ttyname_r_proto=I_IBW;
- ;;
+ ''|0) try='int ttyname_r(int, char*, size_t);'
+ ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
esac
case "$ttyname_r_proto" in
- '') try='extern int ttyname_r(int, char*, int);'
- ./protochk "$try" $hdrs && ttyname_r_proto=I_IBI;
- ;;
+ ''|0) try='int ttyname_r(int, char*, int);'
+ ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
esac
case "$ttyname_r_proto" in
- '') try='extern char* ttyname_r(int, char*, int);'
- ./protochk "$try" $hdrs && ttyname_r_proto=B_IBI;
- ;;
+ ''|0) try='char* ttyname_r(int, char*, int);'
+ ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
esac
case "$ttyname_r_proto" in
- '') d_ttyname_r=undef ; echo "Disabling ttyname_r, cannot find prototype." ;;
- * ) ttyname_r_proto="REENTRANT_$ttyname_r_proto" ; echo "$try" ;;
+ ''|0) d_ttyname_r=undef
+ ttyname_r_proto=0
+ echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
+ * ) case "$ttyname_r_proto" in
+ REENTRANT_PROTO*) ;;
+ *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
+ esac
+ echo "Prototype: $try" ;;
esac
;;
+ *) case "$usethreads" in
+ define) echo "ttyname_r has no prototype, not using it." >&4 ;;
+ esac
+ d_ttyname_r=undef
+ ttyname_r_proto=0
+ ;;
+ esac
+ ;;
+*) ttyname_r_proto=0
+ ;;
esac