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
CommitLineData
7996fb80
JH
1?RCS: $Id$
2?RCS:
3?RCS: Copyright (c) 1999, Jarkko Hietaniemi
41322e17 4?RCS:
65a32477 5?RCS: You may redistribute only under the terms of the Artistic License,
7996fb80
JH
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
65a32477 8?RCS: that same Artistic License; a copy of which may be found at the root
7996fb80
JH
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:.
41322e17 27?F:!ldbl_dig.c
7996fb80
JH
28?LINT:set d_ldbl_dig
29: See if number of significant digits in a double precision number is known
30echo " "
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
41printf("Contains LDBL_DIG");
42#endif
43EOM
44$cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
45if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
46 echo "LDBL_DIG found." >&4
47 val="$define"
48else
49 echo "LDBL_DIG NOT found." >&4
50 val="$undef"
51fi
52$rm -f ldbl_dig.?
53set d_ldbl_dig
54eval $setvar
55