?RCS: $Id$
?RCS:
?RCS: Copyright (c) 1991-1997, 2004-2006, 2012 Raphael Manfredi
?RCS:
?RCS: You may redistribute only under the terms of the Artistic License,
?RCS: as specified in the README file that comes with the distribution.
?RCS: You may reuse parts of this distribution only within the terms of
?RCS: that same Artistic License; a copy of which may be found at the root
?RCS: of the source tree for dist 4.0.
?RCS:
?MAKE:ptrsize: cat rm_try Myread +cc +ccflags
?MAKE:	-pick add $@ %<
?S:ptrsize:
?S:	This variable contains the value of the PTRSIZE symbol, which
?S:	indicates to the C program how many bytes there are in a pointer.
?S:.
?C:PTRSIZE:
?C:	This symbol contains the size of a pointer, so that the C preprocessor
?C:	can make decisions based on it.
?C:.
?H:#define PTRSIZE $ptrsize		/**/
?H:.
?F:!try
: check for length of pointer
echo " "
case "$ptrsize" in
'')
	echo "Checking to see how big your pointers are..." >&4
	$cat >try.c <<'EOCP'
#include <stdio.h>
int main()
{
	printf("%d\n", sizeof(char *));
}
EOCP
	if $cc $ccflags -o try try.c >/dev/null 2>&1 ; then
		dflt=`./try`
	else
		dflt='4'
		echo "(I can't seem to compile the test program.  Guessing...)"
	fi
	;;
*)
	dflt="$ptrsize"
	;;
esac
rp="What is the size of a pointer (in bytes)?"
. ./myread
ptrsize="$ans"
$rm_try

