diff options
author | Aaron Crane <arc@cpan.org> | 2017-10-14 15:20:33 +0200 |
---|---|---|
committer | Aaron Crane <arc@cpan.org> | 2017-10-21 16:53:15 +0100 |
commit | 7e0346596d505ad065530a113109ee0a1ff260e9 (patch) | |
tree | c4395dc365ed178f77faa7fa0d65730a5e1a7e0a | |
parent | 7eab73e249a1c03e84ac85f2162ddab4c4824ac5 (diff) | |
download | perl-7e0346596d505ad065530a113109ee0a1ff260e9.tar.gz |
Rely on C89 <math.h>
This requires a corresponding change in the metaconfig units.
-rwxr-xr-x | Configure | 63 | ||||
-rw-r--r-- | Cross/config.sh-arm-linux | 1 | ||||
-rw-r--r-- | Cross/config.sh-arm-linux-n770 | 1 | ||||
-rw-r--r-- | NetWare/config.wc | 1 | ||||
-rw-r--r-- | NetWare/config_H.wc | 6 | ||||
-rw-r--r-- | Porting/Glossary | 4 | ||||
-rw-r--r-- | Porting/config.sh | 1 | ||||
-rw-r--r-- | Porting/config_H | 6 | ||||
-rwxr-xr-x | config_h.SH | 6 | ||||
-rw-r--r-- | configure.com | 1 | ||||
-rw-r--r-- | perl.h | 22 | ||||
-rw-r--r-- | plan9/config.plan9 | 6 | ||||
-rw-r--r-- | plan9/config_h.sample | 6 | ||||
-rw-r--r-- | plan9/config_sh.sample | 1 | ||||
-rw-r--r-- | symbian/config.sh | 1 | ||||
-rw-r--r-- | uconfig.h | 10 | ||||
-rw-r--r-- | uconfig.sh | 1 | ||||
-rw-r--r-- | uconfig64.sh | 1 | ||||
-rw-r--r-- | win32/config.ce | 1 | ||||
-rw-r--r-- | win32/config.gc | 1 | ||||
-rw-r--r-- | win32/config.vc | 1 | ||||
-rw-r--r-- | win32/config_H.ce | 6 | ||||
-rw-r--r-- | win32/config_H.gc | 6 | ||||
-rw-r--r-- | win32/config_H.vc | 6 |
24 files changed, 19 insertions, 140 deletions
@@ -992,7 +992,6 @@ i_locale='' i_machcthr='' i_malloc='' i_mallocmalloc='' -i_math='' i_memory='' i_mntent='' d_gdbm_ndbm_h_uses_prototypes='' @@ -13973,17 +13972,10 @@ eval $inlibc set fp_class d_fp_class eval $inlibc -: see if this is a math.h system -set math.h i_math -eval $inhdr - : check for fpclassify echo "Checking to see if you have fpclassify..." >&4 $cat >try.c <<EOCP -#$i_math I_MATH -#ifdef I_MATH #include <math.h> -#endif int main() { return fpclassify(1.0) == FP_NORMAL ? 0 : 1; } EOCP set try @@ -15785,10 +15777,7 @@ $rm -f isblank* : check for isfinite echo "Checking to see if you have isfinite..." >&4 $cat >try.c <<EOCP -#$i_math I_MATH -#ifdef I_MATH #include <math.h> -#endif int main() { return isfinite(0.0); } EOCP set try @@ -15810,10 +15799,7 @@ eval $inlibc : check for isinf echo "Checking to see if you have isinf..." >&4 $cat >try.c <<EOCP -#$i_math I_MATH -#ifdef I_MATH #include <math.h> -#endif int main() { return isinf(0.0); } EOCP set try @@ -15835,10 +15821,7 @@ eval $inlibc : check for isless echo "Checking to see if you have isless..." >&4 $cat >try.c <<EOCP -#$i_math I_MATH -#ifdef I_MATH #include <math.h> -#endif int main() { return isless(0.0); } EOCP set try @@ -15856,10 +15839,7 @@ eval $setvar : check for isnan echo "Checking to see if you have isnan..." >&4 $cat >try.c <<EOCP -#$i_math I_MATH -#ifdef I_MATH #include <math.h> -#endif int main() { return isnan(0.0); } EOCP set try @@ -15881,10 +15861,7 @@ eval $inlibc : check for isnormal echo "Checking to see if you have isnormal..." >&4 $cat >try.c <<EOCP -#$i_math I_MATH -#ifdef I_MATH #include <math.h> -#endif int main() { return isnormal(0.0); } EOCP set try @@ -15999,11 +15976,9 @@ eval $inlibc : check to see if math.h defines _LIB_VERSION d_libm_lib_version="$undef" -case $i_math in - $define) - echo " " - echo "Checking to see if your libm supports _LIB_VERSION..." >&4 - $cat >try.c <<EOCP +echo " " +echo "Checking to see if your libm supports _LIB_VERSION..." >&4 +$cat >try.c <<EOCP #include <unistd.h> #include <math.h> int main (int argc, char *argv[]) @@ -16012,18 +15987,15 @@ int main (int argc, char *argv[]) return (0); } /* main */ EOCP - set try - if eval $compile; then - foo=`$run ./try` - echo "Yes, it does ($foo)" >&4 - d_libm_lib_version="$define" - else - echo "No, it does not (probably harmless)" >&4 - fi - $rm_try - ;; - - esac +set try +if eval $compile; then + foo=`$run ./try` + echo "Yes, it does ($foo)" >&4 + d_libm_lib_version="$define" +else + echo "No, it does not (probably harmless)" >&4 + fi +$rm_try : see if link exists set link d_link @@ -16318,7 +16290,7 @@ eval $inlibc : see if prototype for modfl is available echo " " -set d_modflproto modfl $i_math math.h +set d_modflproto modfl define math.h eval $hasproto if $test "$uselongdouble" = "$define"; then @@ -18334,11 +18306,8 @@ eval $inhdr : see if signbit exists $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4 $cat >try.c <<EOCP -#$i_math I_MATH #$i_sunmath I_SUNMATH -#ifdef I_MATH -# include <math.h> -#endif +#include <math.h> #ifdef I_SUNMATH /* Solaris special math library */ # include <sunmath.h> #endif @@ -20062,11 +20031,8 @@ $cat >try.c <<EOP #define LONG_DOUBLESIZE $longdblsize #define LONG_DOUBLEKIND $longdblkind #endif -#$i_math I_MATH #$i_string I_STRING -#ifdef I_MATH #include <math.h> -#endif #ifdef I_STRING # include <string.h> #endif @@ -24468,7 +24434,6 @@ i_locale='$i_locale' i_machcthr='$i_machcthr' i_malloc='$i_malloc' i_mallocmalloc='$i_mallocmalloc' -i_math='$i_math' i_memory='$i_memory' i_mntent='$i_mntent' i_ndbm='$i_ndbm' diff --git a/Cross/config.sh-arm-linux b/Cross/config.sh-arm-linux index c172f93c04..0e4f128975 100644 --- a/Cross/config.sh-arm-linux +++ b/Cross/config.sh-arm-linux @@ -750,7 +750,6 @@ i_locale='define' i_machcthr='undef' i_malloc='define' i_mallocmalloc='undef' -i_math='define' i_memory='undef' i_mntent='define' i_ndbm='undef' diff --git a/Cross/config.sh-arm-linux-n770 b/Cross/config.sh-arm-linux-n770 index 27f29019f4..1b94e74d05 100644 --- a/Cross/config.sh-arm-linux-n770 +++ b/Cross/config.sh-arm-linux-n770 @@ -611,7 +611,6 @@ i_locale='define' i_machcthr='undef' i_malloc='define' i_mallocmalloc='undef' -i_math='define' i_memory='undef' i_mntent='define' i_ndbm='undef' diff --git a/NetWare/config.wc b/NetWare/config.wc index 333bb887e1..5c369069a9 100644 --- a/NetWare/config.wc +++ b/NetWare/config.wc @@ -732,7 +732,6 @@ i_locale='define' i_machcthr='undef' i_malloc='define' i_mallocmalloc='undef' -i_math='define' i_memory='undef' i_mntent='undef' i_ndbm='undef' diff --git a/NetWare/config_H.wc b/NetWare/config_H.wc index 294906135d..9fa1f71a36 100644 --- a/NetWare/config_H.wc +++ b/NetWare/config_H.wc @@ -660,12 +660,6 @@ */ #define I_LOCALE /**/ -/* I_MATH: - * This symbol, if defined, indicates to the C program that it should - * include <math.h>. - */ -#define I_MATH /**/ - /* I_MEMORY: * This symbol, if defined, indicates to the C program that it should * include <memory.h>. diff --git a/Porting/Glossary b/Porting/Glossary index 27078ed4ba..ea8f5c8631 100644 --- a/Porting/Glossary +++ b/Porting/Glossary @@ -3494,10 +3494,6 @@ i_mallocmalloc (i_mallocmalloc.U): This variable conditionally defines the I_MALLOCMALLOC symbol, and indicates whether a C program should include <malloc/malloc.h>. -i_math (i_math.U): - This variable conditionally defines the I_MATH symbol, and indicates - whether a C program may include <math.h>. - i_memory (i_memory.U): This variable conditionally defines the I_MEMORY symbol, and indicates whether a C program should include <memory.h>. diff --git a/Porting/config.sh b/Porting/config.sh index 1187213b3e..29dff40946 100644 --- a/Porting/config.sh +++ b/Porting/config.sh @@ -768,7 +768,6 @@ i_locale='define' i_machcthr='undef' i_malloc='undef' i_mallocmalloc='define' -i_math='define' i_memory='undef' i_mntent='undef' i_ndbm='define' diff --git a/Porting/config_H b/Porting/config_H index ac4c541b64..9cec42dc29 100644 --- a/Porting/config_H +++ b/Porting/config_H @@ -618,12 +618,6 @@ */ #define I_LOCALE /**/ -/* I_MATH: - * This symbol, if defined, indicates to the C program that it should - * include <math.h>. - */ -#define I_MATH /**/ - /* I_MEMORY: * This symbol, if defined, indicates to the C program that it should * include <memory.h>. diff --git a/config_h.SH b/config_h.SH index a774644c3c..f221202d33 100755 --- a/config_h.SH +++ b/config_h.SH @@ -673,12 +673,6 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un */ #$i_locale I_LOCALE /**/ -/* I_MATH: - * This symbol, if defined, indicates to the C program that it should - * include <math.h>. - */ -#$i_math I_MATH /**/ - /* I_MEMORY: * This symbol, if defined, indicates to the C program that it should * include <memory.h>. diff --git a/configure.com b/configure.com index 137b06d902..9d050b9e59 100644 --- a/configure.com +++ b/configure.com @@ -6557,7 +6557,6 @@ $ WC "i_machcthr='undef'" $ WC "i_machcthreads='undef'" $ WC "i_malloc='undef'" $ WC "i_mallocmalloc='undef'" -$ WC "i_math='define'" $ WC "i_memory='undef'" $ WC "i_mntent='undef'" $ WC "i_ndbm='undef'" @@ -4004,26 +4004,10 @@ static PERL_MG_UFUNC(foo_get, index, val) #define PERL_MG_UFUNC(name,ix,sv) I32 name(pTHX_ IV ix, SV *sv) #endif -#ifdef I_MATH -# include <math.h> -# ifdef __VMS +#include <math.h> +#ifdef __VMS /* isfinite and others are here rather than in math.h as C99 stipulates */ -# include <fp.h> -# endif -#else -START_EXTERN_C - double exp (double); - double log (double); - double log10 (double); - double sqrt (double); - double frexp (double,int*); - double ldexp (double,int); - double modf (double,double*); - double sin (double); - double cos (double); - double atan2 (double,double); - double pow (double,double); -END_EXTERN_C +# include <fp.h> #endif #ifndef __cplusplus diff --git a/plan9/config.plan9 b/plan9/config.plan9 index 704a96d56e..b75842f053 100644 --- a/plan9/config.plan9 +++ b/plan9/config.plan9 @@ -664,12 +664,6 @@ */ #define I_LOCALE /**/ -/* I_MATH: - * This symbol, if defined, indicates to the C program that it should - * include <math.h>. - */ -#define I_MATH /**/ - /* I_MEMORY: * This symbol, if defined, indicates to the C program that it should * include <memory.h>. diff --git a/plan9/config_h.sample b/plan9/config_h.sample index 2759f372a7..8dbae1a474 100644 --- a/plan9/config_h.sample +++ b/plan9/config_h.sample @@ -628,12 +628,6 @@ */ #define I_LOCALE /**/ -/* I_MATH: - * This symbol, if defined, indicates to the C program that it should - * include <math.h>. - */ -#define I_MATH /**/ - /* I_MEMORY: * This symbol, if defined, indicates to the C program that it should * include <memory.h>. diff --git a/plan9/config_sh.sample b/plan9/config_sh.sample index 2d30cf162d..74c1680738 100644 --- a/plan9/config_sh.sample +++ b/plan9/config_sh.sample @@ -744,7 +744,6 @@ i_locale='define' i_machcthr='undef' i_malloc='undef' i_mallocmalloc='undef' -i_math='define' i_memory='undef' i_mntent='undef' i_ndbm='undef' diff --git a/symbian/config.sh b/symbian/config.sh index ce2c56eaae..f7c316f916 100644 --- a/symbian/config.sh +++ b/symbian/config.sh @@ -672,7 +672,6 @@ i_locale='define' i_machcthr='undef' i_malloc='undef' i_mallocmalloc='undef' -i_math='define' i_memory='undef' i_mntent='undef' i_ndbm='undef' @@ -638,12 +638,6 @@ */ /*#define I_LOCALE / **/ -/* I_MATH: - * This symbol, if defined, indicates to the C program that it should - * include <math.h>. - */ -#define I_MATH /**/ - /* I_MEMORY: * This symbol, if defined, indicates to the C program that it should * include <memory.h>. @@ -5207,6 +5201,6 @@ #endif /* Generated from: - * fde6b587c10bf240fba012827a4814925eb06869ee98bdba652e94b6c77e16e2 config_h.SH - * 31e7d5c0dd56393cf400a70fb22e332e63a472cb46a601b3903b54d2ece44df0 uconfig.sh + * 614451187d29353fa80ad1412261b053d40e3d76c3d5daf64dd977d9c6f8de80 config_h.SH + * 0640d4c66813ed73e42a7eb45e34f57662c6fe45b11a157223ff7b1cfa2199ba uconfig.sh * ex: set ro: */ diff --git a/uconfig.sh b/uconfig.sh index 5dde050d20..560db2d886 100644 --- a/uconfig.sh +++ b/uconfig.sh @@ -658,7 +658,6 @@ i_locale='undef' i_machcthr='undef' i_malloc='undef' i_mallocmalloc='undef' -i_math='define' i_memory='undef' i_mntent='undef' i_ndbm='undef' diff --git a/uconfig64.sh b/uconfig64.sh index b36d71edfe..c6f64df322 100644 --- a/uconfig64.sh +++ b/uconfig64.sh @@ -658,7 +658,6 @@ i_locale='undef' i_machcthr='undef' i_malloc='undef' i_mallocmalloc='undef' -i_math='define' i_memory='undef' i_mntent='undef' i_ndbm='undef' diff --git a/win32/config.ce b/win32/config.ce index c9711a48e0..956b6cca9c 100644 --- a/win32/config.ce +++ b/win32/config.ce @@ -728,7 +728,6 @@ i_locale='define' i_machcthr='undef' i_malloc='define' i_mallocmalloc='undef' -i_math='define' i_memory='undef' i_mntent='undef' i_ndbm='undef' diff --git a/win32/config.gc b/win32/config.gc index c62ffcf73d..b0b27ea481 100644 --- a/win32/config.gc +++ b/win32/config.gc @@ -742,7 +742,6 @@ i_locale='define' i_machcthr='undef' i_malloc='define' i_mallocmalloc='undef' -i_math='define' i_memory='undef' i_mntent='undef' i_ndbm='undef' diff --git a/win32/config.vc b/win32/config.vc index 0b0148c7e7..654a331cbe 100644 --- a/win32/config.vc +++ b/win32/config.vc @@ -739,7 +739,6 @@ i_locale='define' i_machcthr='undef' i_malloc='define' i_mallocmalloc='undef' -i_math='define' i_memory='undef' i_mntent='undef' i_ndbm='undef' diff --git a/win32/config_H.ce b/win32/config_H.ce index 9a06c82696..6b7efed0f8 100644 --- a/win32/config_H.ce +++ b/win32/config_H.ce @@ -610,12 +610,6 @@ */ /*#define I_LOCALE /**/ -/* I_MATH: - * This symbol, if defined, indicates to the C program that it should - * include <math.h>. - */ -#define I_MATH /**/ - /* I_MEMORY: * This symbol, if defined, indicates to the C program that it should * include <memory.h>. diff --git a/win32/config_H.gc b/win32/config_H.gc index dd7ea58972..7573a3bbc4 100644 --- a/win32/config_H.gc +++ b/win32/config_H.gc @@ -626,12 +626,6 @@ */ #define I_LOCALE /**/ -/* I_MATH: - * This symbol, if defined, indicates to the C program that it should - * include <math.h>. - */ -#define I_MATH /**/ - /* I_MEMORY: * This symbol, if defined, indicates to the C program that it should * include <memory.h>. diff --git a/win32/config_H.vc b/win32/config_H.vc index 664dda3238..ac258764b4 100644 --- a/win32/config_H.vc +++ b/win32/config_H.vc @@ -626,12 +626,6 @@ */ #define I_LOCALE /**/ -/* I_MATH: - * This symbol, if defined, indicates to the C program that it should - * include <math.h>. - */ -#define I_MATH /**/ - /* I_MEMORY: * This symbol, if defined, indicates to the C program that it should * include <memory.h>. |