This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove trailing whitespace on meta-lines in unit files
[metaconfig.git] / dist / U / d_casti32.U
1 ?RCS: $Id$
2 ?RCS:
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
4 ?RCS:
5 ?RCS: You may redistribute only under the terms of the Artistic License,
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 License; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 4.0.
10 ?RCS:
11 ?RCS: Original Author: Andy Dougherty <doughera@lafcol.lafayette.edu>
12 ?RCS:
13 ?RCS: $Log: d_casti32.U,v $
14 ?RCS: Revision 3.0.1.3  1995/05/12  12:10:45  ram
15 ?RCS: patch54: made sure cc and ccflags are conditional dependencies
16 ?RCS:
17 ?RCS: Revision 3.0.1.2  1994/10/29  16:09:37  ram
18 ?RCS: patch36: declare signal handler correctly (ADO)
19 ?RCS:
20 ?RCS: Revision 3.0.1.1  1994/08/29  16:07:06  ram
21 ?RCS: patch32: created by ADO
22 ?RCS:
23 ?X:
24 ?X:     Can the compiler cast large floats to 32-bit integers?
25 ?X:
26 ?MAKE:d_casti32: cat +cc +ccflags rm intsize Setvar test signal_t
27 ?MAKE:  -pick add $@ %<
28 ?S:d_casti32:
29 ?S:     This variable conditionally defines CASTI32, which indicates
30 ?S:     whether the C compiler can cast large floats to 32-bit ints.
31 ?S:.
32 ?C:CASTI32:
33 ?C:     This symbol is defined if the C compiler can cast negative
34 ?C:     or large floating point numbers to 32-bit ints.
35 ?C:.
36 ?T:xxx yyy
37 ?H:#$d_casti32  CASTI32         /**/
38 ?H:.
39 ?F:!try
40 ?LINT:set d_casti32
41 : check for ability to cast large floats to 32-bit ints.
42 echo " "
43 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
44 if $test "$intsize" -eq 4; then
45         xxx=int
46 else
47         xxx=long
48 fi
49 $cat >try.c <<EOCP
50 #include <sys/types.h>
51 #include <signal.h>
52 $signal_t blech() { exit(3); }
53 int main()
54 {
55         $xxx i32;
56         double f;
57         int result = 0;
58         signal(SIGFPE, blech);
59
60         f = (double) 0x7fffffff;
61         f = 10 * f;
62         i32  = ($xxx) f;
63
64         if (i32 != ($xxx) f)
65                 result |= 1;
66         exit(result);
67 }
68 EOCP
69 if $cc $ccflags -o try try.c >/dev/null 2>&1; then
70         ./try
71         yyy=$?
72 else
73         echo "(I can't seem to compile the test program--assuming it can't)"
74         yyy=1
75 fi
76 case "$yyy" in
77 0)      val="$define"
78         echo "Yup, it can."
79         ;;
80 *)      val="$undef"
81         echo "Nope, it can't."
82         ;;
83 esac
84 set d_casti32
85 eval $setvar
86 $rm -f try try.*
87