?RCS: $Id: d_gethostbyaddr_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_gethostbyaddr_r gethostbyaddr_r_proto: Inlibc Protochk Hasproto \
	i_systypes usethreads i_netdb extern_C
?MAKE:	-pick add $@ %<
?S:d_gethostbyaddr_r:
?S:	This variable conditionally defines the HAS_GETHOSTBYADDR_R symbol,
?S:	which indicates to the C program that the gethostbyaddr_r()
?S:	routine is available.
?S:.
?S:gethostbyaddr_r_proto:
?S:	This variable encodes the prototype of gethostbyaddr_r.
?S:	It is zero if d_gethostbyaddr_r is undef, and one of the
?S:	REENTRANT_PROTO_T_ABC macros of reentr.h if d_gethostbyaddr_r
?S:	is defined.
?S:.
?C:HAS_GETHOSTBYADDR_R:
?C:	This symbol, if defined, indicates that the gethostbyaddr_r routine
?C:	is available to gethostbyaddr re-entrantly.
?C:.
?C:GETHOSTBYADDR_R_PROTO:
?C:	This symbol encodes the prototype of gethostbyaddr_r.
?C:	It is zero if d_gethostbyaddr_r is undef, and one of the
?C:	REENTRANT_PROTO_T_ABC macros of reentr.h if d_gethostbyaddr_r
?C:	is defined.
?C:.
?H:#$d_gethostbyaddr_r HAS_GETHOSTBYADDR_R	/**/
?H:#define GETHOSTBYADDR_R_PROTO $gethostbyaddr_r_proto	/**/
?H:.
?T:try hdrs d_gethostbyaddr_r_proto
: see if gethostbyaddr_r exists
set gethostbyaddr_r d_gethostbyaddr_r
eval $inlibc
case "$d_gethostbyaddr_r" in
"$define")
	hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
	case "$d_gethostbyaddr_r_proto:$usethreads" in
	":define")	d_gethostbyaddr_r_proto=define
		set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
		eval $hasproto ;;
	*)	;;
	esac
	case "$d_gethostbyaddr_r_proto" in
	define)
	case "$gethostbyaddr_r_proto" in
	''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
	./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
	esac
	case "$gethostbyaddr_r_proto" in
	''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
	./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
	esac
	case "$gethostbyaddr_r_proto" in
	''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
	./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
	esac
	case "$gethostbyaddr_r_proto" in
	''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
	./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
	esac
	case "$gethostbyaddr_r_proto" in
	''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
	./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
	esac
	case "$gethostbyaddr_r_proto" in
	''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
	./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
	esac
	case "$gethostbyaddr_r_proto" in
	''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
	./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
	esac
	case "$gethostbyaddr_r_proto" in
	''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
	./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
	esac
	case "$gethostbyaddr_r_proto" in
	''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
	./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
	esac
	case "$gethostbyaddr_r_proto" in
	''|0) try='int gethostbyaddr_r(const char*, int, int);'
	./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
	esac
	case "$gethostbyaddr_r_proto" in
	''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
	./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
	esac
	case "$gethostbyaddr_r_proto" in
	''|0)	d_gethostbyaddr_r=undef
		gethostbyaddr_r_proto=0
		echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
	* )	case "$gethostbyaddr_r_proto" in
		REENTRANT_PROTO*) ;;
		*) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
		esac
		echo "Prototype: $try" ;;
	esac
	;;
	*)	case "$usethreads" in
		define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
		esac
		d_gethostbyaddr_r=undef
		gethostbyaddr_r_proto=0
		;;
	esac
	;;
*)	gethostbyaddr_r_proto=0
	;;
esac

