This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix .gitignore: only ignore 'perl' in root of repo, not U/perl subdir
[metaconfig.git] / U / perl / fpossize.U
CommitLineData
6c094af6
JH
1?RCS:
2?RCS: Copyright (c) 1999, Jarkko Hietaniemi
0065f4af 3?RCS:
65a32477 4?RCS: You may redistribute only under the terms of the Artistic License,
6c094af6
JH
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
65a32477 7?RCS: that same Artistic License; a copy of which may be found at the root
6c094af6
JH
8?RCS: of the source tree for dist 3.0.
9?RCS:
3b148aa9 10?MAKE:fpossize: Myread Typedef fpostype Compile longsize run i_stdlib
6c094af6
JH
11?MAKE: -pick add $@ %<
12?S:fpossize:
13?S: This variable contains the size of a fpostype in bytes.
14?S:.
5351ca5b 15?C:Fpos_t_size:
6c094af6
JH
16?C: This symbol holds the size of a Fpos_t in bytes.
17?C:.
5351ca5b 18?H:#define Fpos_t_size $fpossize /* FPOS size */
6c094af6 19?H:.
6c094af6 20?T:yyy zzz
0065f4af 21?F:!try
0065f4af 22: Check size for Fpos_t
6c094af6
JH
23echo " "
24case "$fpostype" in
25*_t) zzz="$fpostype" ;;
26*) zzz="fpos_t" ;;
27esac
0065f4af 28echo "Checking the size of $zzz..." >&4
6c094af6
JH
29cat > 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
6c094af6 36int main() {
37a56d0d 37 printf("%d\n", (int)sizeof($fpostype));
b8fb7a32 38 exit(0);
6c094af6
JH
39}
40EOCP
41set try
42if eval $compile_ok; then
0f00356b 43 yyy=`$run ./try`
6c094af6
JH
44 case "$yyy" in
45 '') fpossize=4
46 echo "(I can't execute the test program--guessing $fpossize.)" >&4
47 ;;
48 *) fpossize=$yyy
08220ae0 49 echo "Your $zzz is $fpossize bytes long."
6c094af6
JH
50 ;;
51 esac
52else
f062a9c5 53 dflt="$longsize"
d75930da 54 echo " " >&4
f062a9c5
JH
55 echo "(I can't compile the test program. Guessing...)" >&4
56 rp="What is the size of your file positions (in bytes)?"
57 . ./myread
58 fpossize="$ans"
6c094af6
JH
59fi
60