-?RCS: $Id$
-?RCS:
-?RCS: Copyright (c) 1999 Jarkko Hietaniemi
+?RCS: $Id: d_strerror_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:
-?MAKE:d_strerror_r strerror_r_proto: Inlibc Protochk i_systypes i_string
+?RCS: Generated by the reentr.pl from the Perl 5.8 distribution.
+?RCS:
+?MAKE:d_strerror_r strerror_r_proto: Inlibc Protochk Hasproto i_systypes usethreads i_string
?MAKE: -pick add $@ %<
?S:d_strerror_r:
?S: This variable conditionally defines the HAS_STRERROR_R symbol,
?S:.
?S:strerror_r_proto:
?S: This variable encodes the prototype of strerror_r.
+?S: It is zero if d_strerror_r is undef, and one of the
+?S: REENTRANT_PROTO_T_ABC macros of reentr.h if d_strerror_r
+?S: is defined.
?S:.
?C:HAS_STRERROR_R:
?C: This symbol, if defined, indicates that the strerror_r routine
?C:.
?C:STRERROR_R_PROTO:
?C: This symbol encodes the prototype of strerror_r.
-?C: 13 int strerror_r(int, char *, int)
-?C: 14 char* strerror_r(int, char *, int)
-?C: 21 int strerror_r(int, char *, size_t)
-?C: 22 char* strerror_r(int, char *, size_t)
-?C: The 21 is preferred since it's the SUSv3/POSIX 1001.3-2001 one.
+?C: It is zero if d_strerror_r is undef, and one of the
+?C: REENTRANT_PROTO_T_ABC macros of reentr.h if d_strerror_r
+?C: is defined.
?C:.
-?H:#$d_strerror_r HAS_STRERROR_R /**/
-?H:#define STRERROR_R_PROTO $strerror_r_proto /**/
+?H:#$d_strerror_r HAS_STRERROR_R /**/
+?H:#define STRERROR_R_PROTO $strerror_r_proto /**/
?H:.
-?T:try hdrs
-?LINT:set d_strerror_r
+?T:try hdrs d_strerror_r_proto
: see if strerror_r exists
set strerror_r d_strerror_r
eval $inlibc
case "$d_strerror_r" in
"$define")
- hdrs="$i_systypes sys/types.h $i_string string.h"
- try='extern int strerror_r(int, char*, size_t);'
- if ./protochk $try $hdrs; then
- echo "Your system has $try"
- strerror_r_proto=21
- else
- try='extern int strerror_r(int, char*, int);'
- if ./protochk $try $hdrs; then
- echo "Your system has $try"
- strerror_r_proto=13
- else
- try='extern char* strerror_r(int, char*, size_t);'
- if ./protochk $try $hdrs; then
- echo "Your system has $try"
- strerror_r_proto=22
- else
- try='extern char* strerror_r(int, char*, int);'
- if ./protochk $try $hdrs; then
- echo "Your system has $try"
- strerror_r_proto=24
- else
- echo "I do not recognize the prototype of your strerror_r, not using it." >&4
- d_strerror_r="$undef"
- strerror_r_proto=0
- fi
- fi
- fi
- fi
+ hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
+ case "$d_strerror_r_proto:$usethreads" in
+ ":define") d_strerror_r_proto=define
+ set d_strerror_r_proto strerror_r $hdrs
+ eval $hasproto ;;
+ *) ;;
+ esac
+ case "$d_strerror_r_proto" in
+ define)
+ case "$strerror_r_proto" in
+ ''|0) try='int strerror_r(int, char*, size_t);'
+ ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
+ esac
+ case "$strerror_r_proto" in
+ ''|0) try='int strerror_r(int, char*, int);'
+ ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
+ esac
+ case "$strerror_r_proto" in
+ ''|0) try='char* strerror_r(int, char*, size_t);'
+ ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
+ esac
+ case "$strerror_r_proto" in
+ ''|0) d_strerror_r=undef
+ strerror_r_proto=0
+ echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
+ * ) case "$strerror_r_proto" in
+ REENTRANT_PROTO*) ;;
+ *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
+ esac
+ echo "Prototype: $try" ;;
+ esac
+ ;;
+ *) case "$usethreads" in
+ define) echo "strerror_r has no prototype, not using it." >&4 ;;
+ esac
+ d_strerror_r=undef
+ strerror_r_proto=0
+ ;;
+ esac
+ ;;
+*) strerror_r_proto=0
;;
-*) strerror_r_proto=0 ;;
esac
-