?RCS: $Id: intsize.U,v 3.0.1.2 1997/02/28 15:55:26 ram Exp $
?RCS:
?RCS: Copyright (c) 1991-1993, Raphael Manfredi
-?RCS:
-?RCS: You may redistribute only under the terms of the Artistic Licence,
+?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 Licence; a copy of which may be found at the root
+?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:
?RCS: $Log: intsize.U,v $
?RCS: Revision 3.0 1993/08/18 12:08:52 ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
-?MAKE:intsize longsize shortsize: Compile Myread cat rm
+?MAKE:intsize longsize shortsize: Compile Myread cat run i_stdlib rm_try
?MAKE: -pick add $@ %<
?S:intsize:
?S: This variable contains the value of the INTSIZE symbol, which
?H:#define LONGSIZE $longsize /**/
?H:#define SHORTSIZE $shortsize /**/
?H:.
-?F:!intsize
+?F:!try
: check for lengths of integral types
echo " "
case "$intsize" in
'')
echo "Checking to see how big your integers are..." >&4
- $cat >intsize.c <<'EOCP'
+ $cat >try.c <<EOCP
#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
int main()
{
@if INTSIZE || intsize
- printf("intsize=%d;\n", sizeof(int));
+ printf("intsize=%d;\n", (int)sizeof(int));
@end
@if LONGSIZE || longsize
- printf("longsize=%d;\n", sizeof(long));
+ printf("longsize=%d;\n", (int)sizeof(long));
@end
@if SHORTSIZE || shortsize
- printf("shortsize=%d;\n", sizeof(short));
+ printf("shortsize=%d;\n", (int)sizeof(short));
@end
exit(0);
}
EOCP
- set intsize
- if eval $compile_ok && ./intsize > /dev/null; then
- eval `./intsize`
+ set try
+ if eval $compile_ok && $run ./try > /dev/null; then
+ eval `$run ./try`
@if INTSIZE || intsize
echo "Your integers are $intsize bytes long."
@end
fi
;;
esac
-$rm -f intsize intsize.*
+$rm_try