This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Rely on C89 <math.h> in Perl-specific units
authorAaron Crane <arc@cpan.org>
Sat, 14 Oct 2017 13:19:58 +0000 (15:19 +0200)
committerAaron Crane <arc@cpan.org>
Sat, 21 Oct 2017 15:45:08 +0000 (16:45 +0100)
U/perl/d_fpclassify.U
U/perl/d_isfinite.U
U/perl/d_isinf.U
U/perl/d_isless.U
U/perl/d_isnan.U
U/perl/d_isnormal.U
U/perl/d_libm_lib_version.U
U/perl/d_modfl.U
U/perl/d_signbit.U
U/perl/d_sprintf_len.U
U/perl/infnan.U

index 54c0438..a7b0509 100644 (file)
@@ -3,7 +3,7 @@
 ?RCS: You may distribute under the terms of either the GNU General Public
 ?RCS: License or the Artistic License, as specified in the README file.
 ?RCS:
-?MAKE:d_fpclassify d_fp_classify: Inlibc cat i_math Compile rm_try Setvar
+?MAKE:d_fpclassify d_fp_classify: Inlibc cat Compile rm_try Setvar
 ?MAKE: -pick add $@ %<
 ?X:the short story is that C99 says use fpclassify.  But the story is confused
 ?X:by systems "partially C99" (or fully "pre C99") which either user fpclassify
 ?X:class       i_math
 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
index 8034071..60f8876 100644 (file)
@@ -5,7 +5,7 @@
 ?RCS: You may distribute under the terms of either the GNU General Public
 ?RCS: License or the Artistic License, as specified in the README file.
 ?RCS:
-?MAKE:d_isfinite: Inlibc cat i_math Compile rm_try Setvar
+?MAKE:d_isfinite: Inlibc cat Compile rm_try Setvar
 ?MAKE: -pick add $@ %<
 ?S:d_isfinite:
 ?S:    This variable conditionally defines the HAS_ISFINITE symbol, which
 : 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
index a08f8e3..ad24b7c 100644 (file)
@@ -5,7 +5,7 @@
 ?RCS: You may distribute under the terms of either the GNU General Public
 ?RCS: License or the Artistic License, as specified in the README file.
 ?RCS:
-?MAKE:d_isinf: Inlibc cat i_math Compile rm_try Setvar
+?MAKE:d_isinf: Inlibc cat Compile rm_try Setvar
 ?MAKE: -pick add $@ %<
 ?S:d_isinf:
 ?S:    This variable conditionally defines the HAS_ISINF symbol, which
 : 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
index 9526268..7e5cfa3 100644 (file)
@@ -1,7 +1,7 @@
 ?RCS: You may distribute under the terms of either the GNU General Public
 ?RCS: License or the Artistic License, as specified in the README file.
 ?RCS:
-?MAKE:d_isless: cat i_math Compile rm_try Setvar
+?MAKE:d_isless: cat Compile rm_try Setvar
 ?MAKE: -pick add $@ %<
 ?S:d_isless:
 ?S:    This variable conditionally defines the HAS_ISLESS symbol, which
 : 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
index a3ec01c..8a92272 100644 (file)
@@ -5,7 +5,7 @@
 ?RCS: You may distribute under the terms of either the GNU General Public
 ?RCS: License or the Artistic License, as specified in the README file.
 ?RCS:
-?MAKE:d_isnan: Inlibc cat i_math Compile rm_try Setvar
+?MAKE:d_isnan: Inlibc cat Compile rm_try Setvar
 ?MAKE: -pick add $@ %<
 ?S:d_isnan:
 ?S:    This variable conditionally defines the HAS_ISNAN symbol, which
 : 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
index 4bf89f3..63935bc 100644 (file)
@@ -1,7 +1,7 @@
 ?RCS: You may distribute under the terms of either the GNU General Public
 ?RCS: License or the Artistic License, as specified in the README file.
 ?RCS:
-?MAKE:d_isnormal: cat i_math Compile Setvar rm_try
+?MAKE:d_isnormal: cat Compile Setvar rm_try
 ?MAKE: -pick add $@ %<
 ?S:d_isnormal:
 ?S:    This variable conditionally defines the HAS_ISNORMAL symbol, which
 : 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
index 2f4a8eb..6074967 100644 (file)
@@ -3,7 +3,7 @@
 ?RCS: You may distribute under the terms of either the GNU General Public
 ?RCS: License or the Artistic License, as specified in the README file.
 ?RCS:
-?MAKE:d_libm_lib_version: Compile cat run rm_try i_math
+?MAKE:d_libm_lib_version: Compile cat run rm_try
 ?MAKE: -pick add $@ %<
 ?S:d_libm_lib_version:
 ?S:    This variable conditionally defines the LIBM_LIB_VERSION symbol,
 ?F:!try
 : 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[])
@@ -33,16 +31,13 @@ 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
 
index 23c42b6..4aa7c5e 100644 (file)
@@ -6,7 +6,7 @@
 ?RCS: License or the Artistic License, as specified in the README file.
 ?RCS:
 ?MAKE:d_modfl d_modflproto: Inlibc Compile Hasproto cat \
-       test ccflags uselongdouble i_math \
+       test ccflags uselongdouble \
        d_sqrtl d_aintl d_copysignl d_ilogbl d_scalbnl d_frexpl d_ldexpl \
        d_truncl
 ?MAKE: -pick add $@ %<
@@ -43,7 +43,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
index d50a281..8dbf01b 100644 (file)
@@ -3,7 +3,7 @@
 ?RCS: You may distribute under the terms of either the GNU General Public
 ?RCS: License or the Artistic License, as specified in the README file.
 ?RCS:
-?MAKE:d_signbit: nvtype Compile Setvar cat run rm_try echo n c i_math i_sunmath
+?MAKE:d_signbit: nvtype Compile Setvar cat run rm_try echo n c i_sunmath
 ?MAKE: -pick add $@ %<
 ?S:d_signbit:
 ?S:    This variable conditionally defines the HAS_SIGNBIT symbol, which
 : 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
index 62b4507..62c19ff 100644 (file)
@@ -3,7 +3,7 @@
 ?RCS: You may distribute under the terms of either the GNU General Public
 ?RCS: License or the Artistic License, as specified in the README file.
 ?RCS:
-?MAKE:d_sprintf_returns_strlen: Compile cat rm_try run i_stdlib i_string i_math echo
+?MAKE:d_sprintf_returns_strlen: Compile cat rm_try run i_stdlib i_string echo
 ?MAKE: -pick add $@ %<
 ?S:d_sprintf_returns_strlen:
 ?S:    This variable defines whether sprintf returns the length of the string
@@ -35,10 +35,7 @@ $cat <<EOP >try.c
 #else
 #  include <strings.h>
 #endif
-#$i_math I_MATH
-#ifdef I_MATH
 #include <math.h>
-#endif
 
 char buffer[256];
 
index a62055a..2d8419a 100644 (file)
@@ -6,7 +6,7 @@
 ?RCS: License or the Artistic License, as specified in the README file.
 ?RCS:
 ?MAKE:longdblinfbytes longdblnanbytes doubleinfbytes doublenanbytes: Inlibc \
-       cat i_math i_string Compile run rm_try Setvar echo d_longdbl \
+       cat i_string Compile run rm_try Setvar echo d_longdbl \
        doublekind doublesize longdblkind longdblsize
 ?MAKE: -pick add $@ %<
 ?S:longdblinfbytes:
@@ -57,11 +57,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