This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
/\=/ does not require \ even in older awk
[metaconfig.git] / U / typedefs / uidsize.U
1 ?RCS:
2 ?RCS: Copyright (c) 1999, Jarkko Hietaniemi
3 ?RCS:
4 ?RCS: You may redistribute only under the terms of the Artistic License,
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 License; a copy of which may be found at the root
8 ?RCS: of the source tree for dist 3.0.
9 ?RCS:
10 ?MAKE:uidsize: Myread Typedef uidtype Compile run i_stdlib
11 ?MAKE:  -pick add $@ %<
12 ?S:uidsize:
13 ?S:     This variable contains the size of a uidtype in bytes.
14 ?S:.
15 ?C:Uid_t_size:
16 ?C:     This symbol holds the size of a Uid_t in bytes.
17 ?C:.
18 ?H:#define Uid_t_size $uidsize          /* UID size */
19 ?H:.
20 ?T:yyy zzz
21 ?F:!try
22 : Check size of UID
23 echo " "
24 case "$uidtype" in
25 *_t) zzz="$uidtype"     ;;
26 *)   zzz="uid"          ;;
27 esac
28 echo "Checking the size of $zzz..." >&4
29 cat > try.c <<EOCP
30 #include <sys/types.h>
31 #include <stdio.h>
32 #$i_stdlib I_STDLIB
33 #ifdef I_STDLIB
34 #include <stdlib.h>
35 #endif
36 int main() {
37     printf("%d\n", (int)sizeof($uidtype));
38     exit(0);
39 }
40 EOCP
41 set try
42 if eval $compile_ok; then
43         yyy=`$run ./try`
44         case "$yyy" in
45         '')     uidsize=4
46                 echo "(I can't execute the test program--guessing $uidsize.)" >&4
47                 ;;
48         *)      uidsize=$yyy
49                 echo "Your $zzz is $uidsize bytes long."
50                 ;;
51         esac
52 else
53         uidsize=4
54         echo "(I can't compile the test program--guessing $uidsize.)" >&4
55 fi
56