?RCS:
?RCS: Copyright (c) 1999, Jarkko Hietaniemi
?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 3.0.
?RCS:
?MAKE:uidsign: Myread Typedef uidtype Compile run
?MAKE:	-pick add $@ %<
?S:uidsign:
?S:	This variable contains the signedness of a uidtype.
?S:	1 for unsigned, -1 for signed.
?S:.
?C:Uid_t_sign:
?C:	This symbol holds the signedness of a Uid_t.
?C:	1 for unsigned, -1 for signed.
?C:.
?H:#define Uid_t_sign	$uidsign		/* UID sign */
?H:.
?T:yyy zzz
?F:!try
: Check if UID is signed
echo " "
case "$uidtype" in
*_t) zzz="$uidtype"	;;
*)   zzz="uid"		;;
esac
echo "Checking the sign of $zzz..." >&4
cat > try.c <<EOCP
#include <sys/types.h>
#include <stdio.h>
int main() {
	$uidtype foo = -1;
	if (foo < 0)
		printf("-1\n");
	else
		printf("1\n");
}
EOCP
set try
if eval $compile; then
	yyy=`$run ./try`
	case "$yyy" in
	'')	uidsign=1
		echo "(I can't execute the test program--guessing unsigned.)" >&4
		;;
	*)	uidsign=$yyy
		case "$uidsign" in
		 1) echo "Your $zzz is unsigned." ;;
		-1) echo "Your $zzz is signed."   ;;
		esac
		;;
	esac
else
	uidsign=1
	echo "(I can't compile the test program--guessing unsigned.)" >&4
fi

