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 / d_ldbl_dig.U
1 ?RCS: $Id$
2 ?RCS:
3 ?RCS: Copyright (c) 1999, Jarkko Hietaniemi
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 3.0.
10 ?RCS:
11 ?MAKE:d_ldbl_dig: Myread contains cat rm Setvar i_limits i_float \
12         cppstdin cppflags cppminus
13 ?MAKE:  -pick add $@ %<
14 ?S:d_ldbl_dig:
15 ?S:     This variable conditionally defines d_ldbl_dig if this system's
16 ?S:     header files provide LDBL_DIG, which is the number of significant
17 ?S:     digits in a long double precision number.
18 ?S:.
19 ?C:HAS_LDBL_DIG:
20 ?C:     This symbol, if defined, indicates that this system's <float.h>
21 ?C:     or <limits.h> defines the symbol LDBL_DIG, which is the number
22 ?C:     of significant digits in a long double precision number. Unlike
23 ?C:     for DBL_DIG, there's no good guess for LDBL_DIG if it is undefined.
24 ?C:.
25 ?H:#$d_ldbl_dig HAS_LDBL_DIG    /* */
26 ?H:.
27 ?F:!ldbl_dig.c
28 ?LINT:set d_ldbl_dig
29 : See if number of significant digits in a double precision number is known
30 echo " "
31 $cat >ldbl_dig.c <<EOM
32 #$i_limits I_LIMITS
33 #$i_float I_FLOAT
34 #ifdef I_LIMITS
35 #include <limits.h>
36 #endif
37 #ifdef I_FLOAT
38 #include <float.h>
39 #endif
40 #ifdef LDBL_DIG
41 printf("Contains LDBL_DIG");
42 #endif
43 EOM
44 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
45 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
46         echo "LDBL_DIG found." >&4
47         val="$define"
48 else
49         echo "LDBL_DIG NOT found." >&4
50         val="$undef"
51 fi
52 $rm -f ldbl_dig.?
53 set d_ldbl_dig
54 eval $setvar
55