Skip to content

Commit

Permalink
Rely on C89 <limits.h>
Browse files Browse the repository at this point in the history
This requires newer metaconfig units that also rely on C89 <limits.h>.
  • Loading branch information
arc committed Oct 21, 2017
1 parent 9245da2 commit 350b922
Show file tree
Hide file tree
Showing 27 changed files with 22 additions and 128 deletions.
12 changes: 0 additions & 12 deletions Configure
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,6 @@ i_ieeefp=''
i_inttypes=''
i_langinfo=''
i_libutil=''
i_limits=''
i_locale=''
i_machcthr=''
i_malloc=''
Expand Down Expand Up @@ -12327,18 +12326,11 @@ esac
set cuserid d_cuserid
eval $inlibc

: see if this is a limits.h system
set limits.h i_limits
eval $inhdr

: See if number of significant digits in a double precision number is known
echo " "
$cat >dbl_dig.c <<EOM
#$i_limits I_LIMITS
#$i_float I_FLOAT
#ifdef I_LIMITS
#include <limits.h>
#endif
#ifdef I_FLOAT
#include <float.h>
#endif
Expand Down Expand Up @@ -16019,11 +16011,8 @@ eval $setvar
: See if number of significant digits in a double precision number is known
echo " "
$cat >ldbl_dig.c <<EOM
#$i_limits I_LIMITS
#$i_float I_FLOAT
#ifdef I_LIMITS
#include <limits.h>
#endif
#ifdef I_FLOAT
#include <float.h>
#endif
Expand Down Expand Up @@ -24570,7 +24559,6 @@ i_ieeefp='$i_ieeefp'
i_inttypes='$i_inttypes'
i_langinfo='$i_langinfo'
i_libutil='$i_libutil'
i_limits='$i_limits'
i_locale='$i_locale'
i_machcthr='$i_machcthr'
i_malloc='$i_malloc'
Expand Down
1 change: 0 additions & 1 deletion Cross/config.sh-arm-linux
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,6 @@ i_ieeefp='undef'
i_inttypes='define'
i_langinfo='define'
i_libutil='undef'
i_limits='define'
i_locale='define'
i_machcthr='undef'
i_malloc='define'
Expand Down
1 change: 0 additions & 1 deletion Cross/config.sh-arm-linux-n770
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,6 @@ i_ieeefp='undef'
i_inttypes='define'
i_langinfo='define'
i_libutil='undef'
i_limits='define'
i_locale='define'
i_machcthr='undef'
i_malloc='define'
Expand Down
1 change: 0 additions & 1 deletion NetWare/config.wc
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,6 @@ i_ieeefp='undef'
i_inttypes='undef'
i_langinfo='undef'
i_libutil='undef'
i_limits='define'
i_locale='define'
i_machcthr='undef'
i_malloc='define'
Expand Down
7 changes: 0 additions & 7 deletions NetWare/config_H.wc
Original file line number Diff line number Diff line change
Expand Up @@ -669,13 +669,6 @@
*/
#define I_FLOAT /**/

/* I_LIMITS:
* This symbol, if defined, indicates to the C program that it should
* include <limits.h> to get definition of symbols like WORD_BIT or
* LONG_MAX, i.e. machine dependant limitations.
*/
#define I_LIMITS /**/

/* I_LOCALE:
* This symbol, if defined, indicates to the C program that it should
* include <locale.h>.
Expand Down
5 changes: 0 additions & 5 deletions Porting/Glossary
Original file line number Diff line number Diff line change
Expand Up @@ -3493,11 +3493,6 @@ i_libutil (i_libutil.U):
This variable conditionally defines the I_LIBUTIL symbol, and indicates
whether a C program should include <libutil.h>.

i_limits (i_limits.U):
This variable conditionally defines the I_LIMITS symbol, and indicates
whether a C program may include <limits.h> to get symbols like WORD_BIT
and friends.

i_locale (i_locale.U):
This variable conditionally defines the I_LOCALE symbol,
and indicates whether a C program should include <locale.h>.
Expand Down
1 change: 0 additions & 1 deletion Porting/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,6 @@ i_ieeefp='undef'
i_inttypes='define'
i_langinfo='define'
i_libutil='undef'
i_limits='define'
i_locale='define'
i_machcthr='undef'
i_malloc='undef'
Expand Down
7 changes: 0 additions & 7 deletions Porting/config_H
Original file line number Diff line number Diff line change
Expand Up @@ -627,13 +627,6 @@
*/
#define I_GDBM /**/

/* I_LIMITS:
* This symbol, if defined, indicates to the C program that it should
* include <limits.h> to get definition of symbols like WORD_BIT or
* LONG_MAX, i.e. machine dependant limitations.
*/
#define I_LIMITS /**/

/* I_LOCALE:
* This symbol, if defined, indicates to the C program that it should
* include <locale.h>.
Expand Down
2 changes: 0 additions & 2 deletions cflags.SH
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ cat >_cflags.c <<__EOT__
#include <stdlib.h>
#include <stddef.h>
#include <stdarg.h>
#ifdef I_LIMITS
#include <limits.h>
#endif
#ifdef I_DIRENT
#include <dirent.h>
#endif
Expand Down
23 changes: 8 additions & 15 deletions config_h.SH
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,6 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
*/
#$d_cuserid HAS_CUSERID /**/
/* HAS_DBL_DIG:
* This symbol, if defined, indicates that this system's <float.h>
* or <limits.h> defines the symbol DBL_DIG, which is the number
* of significant digits in a double precision number. If this
* symbol is not defined, a guess of 15 is usually pretty good.
*/
#$d_dbl_dig HAS_DBL_DIG /**/
/* HAS_DIFFTIME:
* This symbol, if defined, indicates that the difftime routine is
* available.
Expand Down Expand Up @@ -682,13 +674,6 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
*/
#$i_gdbm I_GDBM /**/
/* I_LIMITS:
* This symbol, if defined, indicates to the C program that it should
* include <limits.h> to get definition of symbols like WORD_BIT or
* LONG_MAX, i.e. machine dependant limitations.
*/
#$i_limits I_LIMITS /**/
/* I_LOCALE:
* This symbol, if defined, indicates to the C program that it should
* include <locale.h>.
Expand Down Expand Up @@ -1584,6 +1569,14 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un
#define CSH "$full_csh" /**/
#endif
/* HAS_DBL_DIG:
* This symbol, if defined, indicates that this system's <float.h>
* or <limits.h> defines the symbol DBL_DIG, which is the number
* of significant digits in a double precision number. If this
* symbol is not defined, a guess of 15 is usually pretty good.
*/
#$d_dbl_dig HAS_DBL_DIG /**/
/* HAS_DLADDR:
* This symbol, if defined, indicates that the dladdr() routine is
* available to query dynamic linker information for an address.
Expand Down
1 change: 0 additions & 1 deletion configure.com
Original file line number Diff line number Diff line change
Expand Up @@ -6555,7 +6555,6 @@ $ WC "i_ieeefp='undef'"
$ WC "i_inttypes='" + i_inttypes + "'"
$ WC "i_langinfo='" + i_langinfo + "'"
$ WC "i_libutil='" + i_libutil + "'"
$ WC "i_limits='define'"
$ WC "i_locale='" + i_locale + "'"
$ WC "i_machcthr='undef'"
$ WC "i_machcthreads='undef'"
Expand Down
2 changes: 0 additions & 2 deletions ext/File-Glob/bsd_glob.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ static char sscsid[]= "$OpenBSD: glob.c,v 1.8.10.1 2001/04/10 jason Exp $";
# endif
#endif

#ifdef I_LIMITS
#include <limits.h>
#endif

#ifndef ARG_MAX
# ifdef _SC_ARG_MAX
Expand Down
2 changes: 0 additions & 2 deletions ext/POSIX/POSIX.xs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ static int not_here(const char *s);
#include <fenv.h>
#endif
#endif
#ifdef I_LIMITS
#include <limits.h>
#endif
#include <locale.h>
#include <math.h>
#ifdef I_PWD
Expand Down
16 changes: 4 additions & 12 deletions perl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1689,9 +1689,7 @@ typedef UVTYPE UV;
a given precision of printing can be done with a double instead of
a long double - Allen).
*/
#ifdef I_LIMITS
#include <limits.h>
#endif
#ifdef I_FLOAT
#include <float.h>
#endif
Expand All @@ -1711,9 +1709,7 @@ typedef UVTYPE UV;
default value for printing floating point numbers in Gconvert.
(see config.h)
*/
# ifdef I_LIMITS
# include <limits.h>
# endif
# include <limits.h>
# ifdef I_FLOAT
# include <float.h>
# endif
Expand Down Expand Up @@ -1743,12 +1739,10 @@ typedef UVTYPE UV;
* necessary to do so. - Allen <allens@cpan.org>
*/

#ifdef I_LIMITS
# include <limits.h>
#endif
#include <limits.h>

#ifdef I_VALUES
# if !(defined(DBL_MIN) && defined(DBL_MAX) && defined(I_LIMITS))
# if !defined(DBL_MIN) || !defined(DBL_MAX)
# include <values.h>
# if defined(MAXDOUBLE) && !defined(DBL_MAX)
# define DBL_MAX MAXDOUBLE
Expand Down Expand Up @@ -2340,9 +2334,7 @@ int isnan(double d);
* define PERL ULONG_MAX 4294967295L
*/

#ifdef I_LIMITS /* Needed for cast_xxx() functions below. */
# include <limits.h>
#endif
#include <limits.h> /* Needed for cast_xxx() functions below. */
/* Included values.h above if necessary; still including limits.h down here,
* despite doing above, because math.h might have overridden... XXX - Allen */

Expand Down
7 changes: 0 additions & 7 deletions plan9/config.plan9
Original file line number Diff line number Diff line change
Expand Up @@ -673,13 +673,6 @@
*/
#define I_FLOAT /**/

/* I_LIMITS:
* This symbol, if defined, indicates to the C program that it should
* include <limits.h> to get definition of symbols like WORD_BIT or
* LONG_MAX, i.e. machine dependant limitations.
*/
#define I_LIMITS /**/

/* I_LOCALE:
* This symbol, if defined, indicates to the C program that it should
* include <locale.h>.
Expand Down
7 changes: 0 additions & 7 deletions plan9/config_h.sample
Original file line number Diff line number Diff line change
Expand Up @@ -637,13 +637,6 @@
*/
#define I_FLOAT /**/

/* I_LIMITS:
* This symbol, if defined, indicates to the C program that it should
* include <limits.h> to get definition of symbols like WORD_BIT or
* LONG_MAX, i.e. machine dependant limitations.
*/
#define I_LIMITS /**/

/* I_LOCALE:
* This symbol, if defined, indicates to the C program that it should
* include <locale.h>.
Expand Down
1 change: 0 additions & 1 deletion plan9/config_sh.sample
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,6 @@ i_ieeefp='undef'
i_inttypes='define'
i_langinfo='undef'
i_libutil='undef'
i_limits='define'
i_locale='define'
i_machcthr='undef'
i_malloc='undef'
Expand Down
1 change: 0 additions & 1 deletion symbian/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,6 @@ i_ieeefp='undef'
i_inttypes='undef'
i_langinfo='undef'
i_libutil='undef'
i_limits='define'
i_locale='define'
i_machcthr='undef'
i_malloc='undef'
Expand Down
27 changes: 10 additions & 17 deletions uconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,6 @@
*/
/*#define HAS_CUSERID / **/

/* HAS_DBL_DIG:
* This symbol, if defined, indicates that this system's <float.h>
* or <limits.h> defines the symbol DBL_DIG, which is the number
* of significant digits in a double precision number. If this
* symbol is not defined, a guess of 15 is usually pretty good.
*/
/*#define HAS_DBL_DIG / **/

/* HAS_DIFFTIME:
* This symbol, if defined, indicates that the difftime routine is
* available.
Expand Down Expand Up @@ -647,13 +639,6 @@
*/
/*#define I_GDBM / **/

/* I_LIMITS:
* This symbol, if defined, indicates to the C program that it should
* include <limits.h> to get definition of symbols like WORD_BIT or
* LONG_MAX, i.e. machine dependant limitations.
*/
/*#define I_LIMITS / **/

/* I_LOCALE:
* This symbol, if defined, indicates to the C program that it should
* include <locale.h>.
Expand Down Expand Up @@ -1549,6 +1534,14 @@
#define CSH "" /**/
#endif

/* HAS_DBL_DIG:
* This symbol, if defined, indicates that this system's <float.h>
* or <limits.h> defines the symbol DBL_DIG, which is the number
* of significant digits in a double precision number. If this
* symbol is not defined, a guess of 15 is usually pretty good.
*/
/*#define HAS_DBL_DIG / **/

/* HAS_DLADDR:
* This symbol, if defined, indicates that the dladdr() routine is
* available to query dynamic linker information for an address.
Expand Down Expand Up @@ -5249,6 +5242,6 @@
#endif

/* Generated from:
* ef59adc025306aceebb47a7515e514357b77e44a359af4bc0bf5d52082e41a26 config_h.SH
* d40282b246b20f1f20a5febcae42b3ac44234c5a1c1a2df89e5ac77a54830cca uconfig.sh
* 82aa50fd961b36e3bc3ab644715698645fed961055bc70f4ad44ad88f51c25b0 config_h.SH
* 37da610aa9e38f4374ef9ce47cd7cd08240a33511faa8ee028f9e33ee76587ca uconfig.sh
* ex: set ro: */
1 change: 0 additions & 1 deletion uconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,6 @@ i_ieeefp='undef'
i_inttypes='undef'
i_langinfo='undef'
i_libutil='undef'
i_limits='undef'
i_locale='undef'
i_machcthr='undef'
i_malloc='undef'
Expand Down
1 change: 0 additions & 1 deletion uconfig64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,6 @@ i_ieeefp='undef'
i_inttypes='undef'
i_langinfo='undef'
i_libutil='undef'
i_limits='undef'
i_locale='undef'
i_machcthr='undef'
i_malloc='undef'
Expand Down
1 change: 0 additions & 1 deletion win32/config.ce
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,6 @@ i_ieeefp='undef'
i_inttypes='undef'
i_langinfo='undef'
i_libutil='undef'
i_limits='define'
i_locale='define'
i_machcthr='undef'
i_malloc='define'
Expand Down
1 change: 0 additions & 1 deletion win32/config.gc
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,6 @@ i_ieeefp='undef'
i_inttypes='undef'
i_langinfo='undef'
i_libutil='undef'
i_limits='define'
i_locale='define'
i_machcthr='undef'
i_malloc='define'
Expand Down
1 change: 0 additions & 1 deletion win32/config.vc
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,6 @@ i_ieeefp='undef'
i_inttypes='undef'
i_langinfo='undef'
i_libutil='undef'
i_limits='define'
i_locale='define'
i_machcthr='undef'
i_malloc='define'
Expand Down
7 changes: 0 additions & 7 deletions win32/config_H.ce
Original file line number Diff line number Diff line change
Expand Up @@ -619,13 +619,6 @@
*/
#define I_FLOAT /**/

/* I_LIMITS:
* This symbol, if defined, indicates to the C program that it should
* include <limits.h> to get definition of symbols like WORD_BIT or
* LONG_MAX, i.e. machine dependant limitations.
*/
#define I_LIMITS /**/

/* I_LOCALE:
* This symbol, if defined, indicates to the C program that it should
* include <locale.h>.
Expand Down
Loading

0 comments on commit 350b922

Please sign in to comment.