1 ?RCS: $Id: d_casti32.U,v 3.0.1.3 1995/05/12 12:10:45 ram Exp $
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
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 Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.0.
11 ?RCS: Original Author: Andy Dougherty <doughera@lafcol.lafayette.edu>
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
17 ?RCS: Revision 3.0.1.2 1994/10/29 16:09:37 ram
18 ?RCS: patch36: declare signal handler correctly (ADO)
20 ?RCS: Revision 3.0.1.1 1994/08/29 16:07:06 ram
21 ?RCS: patch32: created by ADO
24 ?X: Can the compiler cast large floats to 32-bit integers?
26 ?MAKE:d_casti32: cat Compile rm_try intsize Setvar test signal_t run i_stdlib
27 ?MAKE: -pick add $@ %<
29 ?S: This variable conditionally defines CASTI32, which indicates
30 ?S: whether the C compiler can cast large floats to 32-bit ints.
33 ?C: This symbol is defined if the C compiler can cast negative
34 ?C: or large floating point numbers to 32-bit ints.
36 ?H:#$d_casti32 CASTI32 /**/
41 : check for ability to cast large floats to 32-bit ints.
43 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
44 if $test "$intsize" -ge 4; then
55 #include <sys/types.h>
57 $signal_t blech(int s) { exit(3); }
64 signal(SIGFPE, blech);
66 /* Don't let compiler optimize the test away. Store the number
67 in a writable string for gcc to pass to sscanf under HP-UX.
69 sprintf(str, "2147483647");
70 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
74 /* x86 processors will probably give 0x8000 0000, which is a
75 sign change. We don't want that. We want to mimic SPARC
76 behavior here, which is to preserve the sign and give
85 if eval $compile_ok; then
89 echo "(I can't seem to compile the test program--assuming it can't)"
97 echo "Nope, it can't."