Commit | Line | Data |
---|---|---|
5d52f3dc JH |
1 | ?RCS: |
2 | ?RCS: Copyright (c) 1999, Jarkko Hietaniemi | |
3 | ?RCS: | |
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: | |
10 | ?MAKE:gidsign: Myread Typedef gidtype | |
11 | ?MAKE: -pick add $@ %< | |
12 | ?S:gidsign: | |
13 | ?S: This variable contains the signedness of a gidtype. | |
14 | ?S: 1 for unsigned, -1 for signed. | |
15 | ?S:. | |
16 | ?C:Gid_t_SIGN: | |
17 | ?C: This symbol holds the signedess of a Gid_t. | |
18 | ?C: 1 for unsigned, -1 for signed. | |
19 | ?C:. | |
20 | ?H:#define Gid_t_SIGN $gidsign /* GID sign */ | |
21 | ?H:. | |
22 | ?F:!try | |
23 | ?T:yyy | |
24 | ?LINT: set gidsign | |
25 | echo " " | |
26 | echo "Checking the sign of $gidtype..." >&4 | |
27 | ry.c <<'EOCP' | |
28 | #include <sys/types.h> | |
29 | #include <stdio.h> | |
30 | int main() { | |
31 | $gidtype foo = -1; | |
32 | if (foo < 0) | |
33 | printf("-1\n"); | |
34 | else | |
35 | printf("1\n"); | |
36 | } | |
37 | EOCP | |
38 | if eval $compile; then | |
39 | yyy=`./try` | |
40 | case "$yyy" in | |
41 | '') gidsign=1 | |
42 | echo "(I can't execute the test program--guessing unsigned.)" >&4 | |
43 | ;; | |
44 | *) gidsign=$yyy | |
45 | case "$gidsign" in | |
46 | 1) echo "Your $gidtype is unsigned." ;; | |
47 | -1) echo "Your $gidtype is signed." ;; | |
48 | esac | |
49 | esac | |
50 | else | |
51 | gidsign=1 | |
52 | echo "(I can't compile the test program--guessing unsigned.)" >&4 | |
53 | fi | |
54 | ||
55 |