Commit | Line | Data |
---|---|---|
d048fb47 JH |
1 | ?RCS: |
2 | ?RCS: Copyright (c) 1999, Jarkko Hietaniemi | |
0065f4af | 3 | ?RCS: |
d048fb47 JH |
4 | ?RCS: You may redistribute only under the terms of the Artistic Licence, |
5 | ?RCS: as specified in the README file that comes with the distribution. | |
6 | ?RCS: You may reuse parts of this distribution only within the terms of | |
7 | ?RCS: that same Artistic Licence; a copy of which may be found at the root | |
8 | ?RCS: of the source tree for dist 3.0. | |
9 | ?RCS: | |
3b148aa9 | 10 | ?MAKE:sizesize: Myread Typedef sizetype Compile run i_stdlib |
d048fb47 JH |
11 | ?MAKE: -pick add $@ %< |
12 | ?S:sizesize: | |
13 | ?S: This variable contains the size of a sizetype in bytes. | |
14 | ?S:. | |
15 | ?C:Size_t_size: | |
16 | ?C: This symbol holds the size of a Size_t in bytes. | |
17 | ?C:. | |
a8383192 | 18 | ?H:#define Size_t_size $sizesize /**/ |
d048fb47 | 19 | ?H:. |
d048fb47 | 20 | ?T:yyy zzz |
0065f4af | 21 | ?F:!try |
0065f4af | 22 | : Check size of size |
d048fb47 JH |
23 | echo " " |
24 | case "$sizetype" in | |
25 | *_t) zzz="$sizetype" ;; | |
26 | *) zzz="filesize" ;; | |
27 | esac | |
0065f4af | 28 | echo "Checking the size of $zzz..." >&4 |
d048fb47 JH |
29 | cat > try.c <<EOCP |
30 | #include <sys/types.h> | |
31 | #include <stdio.h> | |
3b148aa9 JH |
32 | #$i_stdlib I_STDLIB |
33 | #ifdef I_STDLIB | |
34 | #include <stdlib.h> | |
35 | #endif | |
d048fb47 JH |
36 | int main() { |
37 | printf("%d\n", (int)sizeof($sizetype)); | |
38 | exit(0); | |
39 | } | |
40 | EOCP | |
41 | set try | |
42 | if eval $compile_ok; then | |
0f00356b | 43 | yyy=`$run ./try` |
d048fb47 JH |
44 | case "$yyy" in |
45 | '') sizesize=4 | |
46 | echo "(I can't execute the test program--guessing $sizesize.)" >&4 | |
47 | ;; | |
48 | *) sizesize=$yyy | |
49 | echo "Your $zzz size is $sizesize bytes." | |
50 | ;; | |
51 | esac | |
52 | else | |
53 | sizesize=4 | |
54 | echo "(I can't compile the test program--guessing $sizesize.)" >&4 | |
55 | fi | |
56 | ||
57 |