?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_memrchr: Inlibc Hasproto d_gnulibc
?MAKE:	-pick add $@ %<
?S:d_memrchr:
?S:	This variable conditionally defines the HAS_MEMRCHR symbol, which
?S:	indicates to the C program that the memrchr() routine is available
?S:	to return a pointer to the last occurrence of a byte in a memory
?S:	area (or NULL if not found).
?S:.
?C:HAS_MEMRCHR:
?C:	This symbol, if defined, indicates that the memrchr routine is
?C:	available to return a pointer to the last occurrence of a byte in
?C:	a memory area (or NULL if not found).
?C:.
?H:#$d_memrchr HAS_MEMRCHR		/**/
?H:.
?T:d_memrchr_proto xx1 xx2 xx3 xx4
?LINT:set d_memrchr
: see if memrchr exists
: We need both a prototype in string.h and the symbol in libc.
echo " "
d_memrchr_proto=''
xx1="#$d_gnulibc HAS_GNULIBC"
xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
xx3='#   define _GNU_SOURCE'
xx4='#endif'
set d_memrchr_proto memrchr literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
eval $hasproto
case "$d_memrchr_proto" in
    define) # see if memrchr exists
	set memrchr d_memrchr
	eval $inlibc
	;;
    *)  val=$undef
	set d_memrchr
	eval $setvar
	;;
esac

