Commit | Line | Data |
---|---|---|
db0821ec | 1 | ?RCS: Copyright (c) 2000,2014 Jarkko Hietaniemi |
863963f1 JH |
2 | ?RCS: |
3 | ?RCS: You may distribute under the terms of either the GNU General Public | |
4 | ?RCS: License or the Artistic License, as specified in the README file. | |
5 | ?RCS: | |
db0821ec | 6 | ?MAKE:d_fpclassify d_fp_classify: Inlibc cat i_math Compile rm_try Setvar |
863963f1 | 7 | ?MAKE: -pick add $@ %< |
db0821ec MBT |
8 | ?X:the short story is that C99 says use fpclassify. But the story is confused |
9 | ?X:by systems "partially C99" (or fully "pre C99") which either user fpclassify | |
10 | ?X:but with different return values, or they use fp_classify (with the expected) | |
11 | ?X:return values, or they use some other spelling of *fp*class* (sometimes even | |
12 | ?X:without the *fp* part), with yet another set(s) of return values ... | |
863963f1 JH |
13 | ?S:d_fpclassify: |
14 | ?S: This variable conditionally defines the HAS_FPCLASSIFY symbol, which | |
15 | ?S: indicates to the C program that the fpclassify() routine is available. | |
16 | ?S:. | |
db0821ec MBT |
17 | ?S:d_fp_classify: |
18 | ?S: This variable conditionally defines the HAS_FP_CLASSIFY symbol, which | |
19 | ?S: indicates to the C program that the fp_classify() routine is available. | |
20 | ?S:. | |
863963f1 JH |
21 | ?C:HAS_FPCLASSIFY: |
22 | ?C: This symbol, if defined, indicates that the fpclassify routine is | |
23 | ?C: available to classify doubles. Available for example in HP-UX. | |
24 | ?C: The returned values are defined in <math.h> and are | |
25 | ?C: | |
26 | ?C: FP_NORMAL Normalized | |
27 | ?C: FP_ZERO Zero | |
28 | ?C: FP_INFINITE Infinity | |
29 | ?C: FP_SUBNORMAL Denormalized | |
30 | ?C: FP_NAN NaN | |
31 | ?C: | |
32 | ?C:. | |
db0821ec MBT |
33 | ?C:HAS_FP_CLASSIFY: |
34 | ?C: This symbol, if defined, indicates that the fp_classify routine is | |
35 | ?C: available to classify doubles. The values are defined in <math.h> | |
36 | ?C: | |
37 | ?C: FP_NORMAL Normalized | |
38 | ?C: FP_ZERO Zero | |
39 | ?C: FP_INFINITE Infinity | |
40 | ?C: FP_SUBNORMAL Denormalized | |
41 | ?C: FP_NAN NaN | |
42 | ?C: | |
43 | ?C:. | |
44 | ?H:#$d_fpclassify HAS_FPCLASSIFY /**/ | |
45 | ?H:#$d_fp_classify HAS_FP_CLASSIFY /**/ | |
863963f1 JH |
46 | ?H:. |
47 | ?LINT:set d_fpclassify | |
db0821ec MBT |
48 | ?LINT:set d_fp_classify |
49 | : check for fpclassify | |
50 | ?X:classified (Comment by jhi) | |
51 | ?X:fpclassify i_math | |
52 | ?X:fp_classify i_math | |
53 | ?X:fpclass i_math i_ieeefp i_fp | |
54 | ?X:fp_class i_math i_fp_class | |
55 | ?X: No i_fp_class yet. But the systems that have | |
56 | ?X: this (Tru64 and IRIX) both had <fp_class.h> | |
57 | ?X:class i_math | |
58 | echo "Checking to see if you have fpclassify..." >&4 | |
59 | $cat >try.c <<EOCP | |
60 | #$i_math I_MATH | |
61 | #ifdef I_MATH | |
62 | #include <math.h> | |
63 | #endif | |
64 | int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; } | |
65 | EOCP | |
66 | set try | |
67 | if eval $compile; then | |
68 | val="$define" | |
69 | echo "You have fpclassify." | |
70 | else | |
71 | val="$undef" | |
72 | echo "You do not have fpclassify." | |
73 | fi | |
74 | $rm_try | |
75 | set d_fpclassify | |
76 | eval $setvar | |
77 | ||
78 | : see if fp_classify exists | |
79 | set fp_classify d_fp_classify | |
863963f1 JH |
80 | eval $inlibc |
81 |