Commit | Line | Data |
---|---|---|
959f3c4c JH |
1 | ?RCS: $Id: ptrsize.U,v 3.0.1.1 1994/10/29 16:28:19 ram Exp $ |
2 | ?RCS: | |
3 | ?RCS: Copyright (c) 1991-1993, Raphael Manfredi | |
4 | ?RCS: | |
5 | ?RCS: You may redistribute only under the terms of the Artistic Licence, | |
6 | ?RCS: as specified in the README file that comes with the distribution. | |
7 | ?RCS: You may reuse parts of this distribution only within the terms of | |
8 | ?RCS: that same Artistic Licence; a copy of which may be found at the root | |
9 | ?RCS: of the source tree for dist 3.0. | |
10 | ?RCS: | |
11 | ?RCS: $Log: ptrsize.U,v $ | |
12 | ?RCS: Revision 3.0.1.1 1994/10/29 16:28:19 ram | |
13 | ?RCS: patch36: added ?F: line for metalint file checking | |
14 | ?RCS: | |
15 | ?RCS: Revision 3.0 1993/08/18 12:09:37 ram | |
16 | ?RCS: Baseline for dist 3.0 netwide release. | |
17 | ?RCS: | |
18 | ?MAKE:ptrsize: cat rm Myread +cc +ccflags | |
19 | ?MAKE: -pick add $@ %< | |
20 | ?S:ptrsize: | |
21 | ?S: This variable contains the value of the PTRSIZE symbol, which | |
22 | ?S: indicates to the C program how many bytes there are in a pointer. | |
23 | ?S:. | |
24 | ?C:PTRSIZE: | |
25 | ?C: This symbol contains the size of a pointer, so that the C preprocessor | |
26 | ?C: can make decisions based on it. | |
27 | ?C:. | |
28 | ?H:#define PTRSIZE $ptrsize /**/ | |
29 | ?H:. | |
30 | ?F:!try | |
31 | : check for length of pointer | |
32 | echo " " | |
33 | case "$ptrsize" in | |
34 | '') | |
35 | echo "Checking to see how big your pointers are..." >&4 | |
36 | $cat >try.c <<'EOCP' | |
37 | #include <stdio.h> | |
38 | main() | |
39 | { | |
40 | printf("%d\n", sizeof(char *)); | |
41 | } | |
42 | EOCP | |
43 | if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then | |
44 | dflt=`./try` | |
45 | else | |
46 | dflt='4' | |
47 | echo "(I can't seem to compile the test program. Guessing...)" | |
48 | fi | |
49 | ;; | |
50 | *) | |
51 | dflt="$ptrsize" | |
52 | ;; | |
53 | esac | |
54 | rp="What is the size of a pointer (in bytes)?" | |
55 | . ./myread | |
56 | ptrsize="$ans" | |
57 | $rm -f try.c try | |
58 |