This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
U/perl/d_ldbl_dig.U: assume C89 <limits.h>
[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:
b5308cc5 11?MAKE:d_ldbl_dig: Myread contains cat rm Setvar i_float \
7996fb80
JH
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
7996fb80 32#$i_float I_FLOAT
7996fb80 33#include <limits.h>
7996fb80
JH
34#ifdef I_FLOAT
35#include <float.h>
36#endif
37#ifdef LDBL_DIG
38printf("Contains LDBL_DIG");
39#endif
40EOM
41$cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
42if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
43 echo "LDBL_DIG found." >&4
44 val="$define"
45else
46 echo "LDBL_DIG NOT found." >&4
47 val="$undef"
48fi
49$rm -f ldbl_dig.?
50set d_ldbl_dig
51eval $setvar
52