In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/fa86ae13872f74d2cb666552bfbe1b1bdd361267?hp=64ff300be0f7714585466af5bb87b2e37db5082a>
- Log ----------------------------------------------------------------- commit fa86ae13872f74d2cb666552bfbe1b1bdd361267 Author: Jarkko Hietaniemi <[email protected]> Date: Sun Aug 31 17:37:28 2014 -0400 POSIX math: Solaris needs -lsunmath. M ext/POSIX/Makefile.PL commit a5f1a7e5d7f236f69b29247eb6053411c88876f0 Author: Jarkko Hietaniemi <[email protected]> Date: Sun Aug 31 16:02:42 2014 -0400 POSIX math: use POSIX now imports Inf and NaN. The import illusion is not flawless: print -Inf Ambiguous use of -Inf resolved as -&Inf() at -e line 1. -Inf Would need toke.c trip, I guess. Also, try definining the C99 INFINITY and NAN even if <math.h> didn't. M ext/POSIX/Makefile.PL M ext/POSIX/POSIX.xs M ext/POSIX/lib/POSIX.pm M ext/POSIX/t/export.t commit 1ae5100030ec267efa29f70a313efdf024dd4dd7 Author: Jarkko Hietaniemi <[email protected]> Date: Sun Aug 31 15:40:51 2014 -0400 POSIX math: fpclassify continues. M ext/POSIX/POSIX.xs M perl.h commit 85c93440df5753bca10d1a8ecf801379133d71d5 Author: Jarkko Hietaniemi <[email protected]> Date: Sun Aug 31 15:07:13 2014 -0400 POSIX math: Bessel fixes. M ext/POSIX/POSIX.xs commit 8ef03df4bb3fe7103d713d2faaaa38a0342ac542 Author: Jarkko Hietaniemi <[email protected]> Date: Sun Aug 31 11:03:48 2014 -0400 POSIX math: todo for emulating fegetround() with fpgetround(). M ext/POSIX/POSIX.xs commit 4c1a9b0c1cd511f382b94a6bf9698242dbf2342a Author: Jarkko Hietaniemi <[email protected]> Date: Sun Aug 31 10:51:40 2014 -0400 POSIX math: Configure scan fpgetround Legacy BSD way of fegetround. M Configure M Cross/config.sh-arm-linux M NetWare/config.wc M Porting/Glossary M Porting/config.sh M config_h.SH M configure.com M plan9/config_sh.sample M symbian/config.sh M uconfig.h M uconfig.sh M uconfig64.sh M win32/config.ce M win32/config.gc M win32/config.vc commit d5f4f26a609ca54aaae457e0dfefb1b93929a317 Author: Jarkko Hietaniemi <[email protected]> Date: Sat Aug 30 10:34:41 2014 -0400 POSIX math: lrint and rint emulations. M ext/B/t/concise-xs.t M ext/POSIX/POSIX.xs commit a5713e21bb0aef1bb1bedbc6850b0a11d32a621c Author: Jarkko Hietaniemi <[email protected]> Date: Sat Aug 30 09:56:51 2014 -0400 POSIX math: Add fegetround() and fesetround(). M ext/B/t/concise-xs.t M ext/POSIX/Makefile.PL M ext/POSIX/POSIX.xs M ext/POSIX/lib/POSIX.pm M ext/POSIX/t/export.t commit 360baf4922ed706db3a0d6d19d9772714f6256a3 Author: Jarkko Hietaniemi <[email protected]> Date: Sat Aug 30 09:28:43 2014 -0400 POSIX math: More handling of legacy implementations. M ext/POSIX/POSIX.xs commit 2f6b96eb42d99b04896d80305f8877cb2440cf44 Author: Jarkko Hietaniemi <[email protected]> Date: Sat Aug 30 09:17:11 2014 -0400 POSIX math: Configure scan d_fegetround and i_fenv. M Configure M Cross/config.sh-arm-linux M NetWare/config.wc M Porting/Glossary M Porting/config.sh M config_h.SH M configure.com M plan9/config_sh.sample M symbian/config.sh M uconfig.h M uconfig.sh M uconfig64.sh M win32/config.ce M win32/config.gc M win32/config.vc commit 935e3c48aca0518881b33f771790170d02704a26 Author: Jarkko Hietaniemi <[email protected]> Date: Sat Aug 30 08:54:19 2014 -0400 POSIX math: fpclassify emulation. M ext/POSIX/POSIX.xs commit 39b5f1c42e8171dd236a435af20ce1ff13c1af47 Author: Jarkko Hietaniemi <[email protected]> Date: Fri Aug 29 22:11:58 2014 -0400 POSIX math: Portability emulations and constants. Plus fix the cmp_ok tests which had epsilon 18 magnitudes off. (Didn't cause any false positives, luckily.) M ext/POSIX/POSIX.xs M ext/POSIX/t/math.t commit d2bce0fdf1a48c474f385b70ce22910b7b7a46a7 Author: Jarkko Hietaniemi <[email protected]> Date: Fri Aug 29 20:31:56 2014 -0400 POSIX math: HP-UX exceptions. M ext/POSIX/POSIX.xs commit 5716d070ddcad04a9a92182a0aaaf5f21fa82a33 Author: Jarkko Hietaniemi <[email protected]> Date: Fri Aug 29 14:56:43 2014 -0400 POSIX math: Have only one not_here for each API. M ext/POSIX/POSIX.xs M ext/POSIX/t/math.t commit bfce4ab34bd059d6d670b9f2fa1e3504674b4a3d Author: Jarkko Hietaniemi <[email protected]> Date: Fri Aug 29 10:38:56 2014 -0400 POSIX math: Win32 shuffling. M ext/POSIX/POSIX.xs M ext/POSIX/t/math.t commit a2f810b5d0f87990ab4437118e0beb3476570d5a Author: Jarkko Hietaniemi <[email protected]> Date: Fri Aug 29 09:52:58 2014 -0400 POSIX math: Use HAS_ACOSH to enable/disable the C99 math. M ext/POSIX/POSIX.xs commit 249502aef7979fe8a69a7ef8513f7599498e227d Author: Jarkko Hietaniemi <[email protected]> Date: Fri Aug 29 09:46:06 2014 -0400 POSIX math: Skip the POSIX C99 math tests if no acosh(). M ext/POSIX/t/math.t commit 40613a90fecb6a31e56e115354a9132233d08267 Author: Jarkko Hietaniemi <[email protected]> Date: Fri Aug 29 09:42:58 2014 -0400 POSIX math: Configure scan for acosh. M Configure M Cross/config.sh-arm-linux M NetWare/config.wc M Porting/Glossary M Porting/config.sh M config_h.SH M configure.com M plan9/config_sh.sample M symbian/config.sh M uconfig.h M uconfig.sh M uconfig64.sh M win32/config.ce M win32/config.gc M win32/config.vc commit 1a91763981b88d10618c92a35adc63bbe749952f Author: Jarkko Hietaniemi <[email protected]> Date: Fri Aug 29 09:37:20 2014 -0400 POSIX math: Add more C99 math tests. (Note: these all will fail if we don't have C99 math. Duh.) M ext/POSIX/t/math.t M ext/POSIX/t/posix.t commit 03397f966bca34874fd5568254e221e5dcf6a08c Author: Jarkko Hietaniemi <[email protected]> Date: Fri Aug 29 09:20:43 2014 -0400 POSIX math: Hopefully better use of Configure symbols. M ext/POSIX/POSIX.xs commit 4671125a23a2a45c14ccbb2ff4ef13b3bf14153d Author: Jarkko Hietaniemi <[email protected]> Date: Fri Aug 29 09:01:36 2014 -0400 POSIX math: Configure scan for j0 and j0l. (j0 is canary forthe Bessel functions, common math.h extensions, not dependent on C99, j0l is its long double version.) M Configure M Cross/config.sh-arm-linux M NetWare/config.wc M Porting/Glossary M Porting/config.sh M config_h.SH M configure.com M plan9/config_sh.sample M symbian/config.sh M uconfig.sh M uconfig64.sh M win32/config.ce M win32/config.gc M win32/config.vc commit aae687ad3fb0a39bf8b6c88bff7f361df9f5c46b Author: Jarkko Hietaniemi <[email protected]> Date: Fri Aug 29 08:21:46 2014 -0400 POSIX math: Add FP_ILOGB0 and FP_ILOGBNAN. M ext/POSIX/Makefile.PL M ext/POSIX/lib/POSIX.pm M ext/POSIX/t/export.t commit 7965edec715460c994530f0ab3803b5845c15d7b Author: Jarkko Hietaniemi <[email protected]> Date: Wed Aug 27 20:52:39 2014 -0400 POSIX math: Implement glue for the C99 math functions. Plus the Bessel functions j0, j1, jn, y0, y1, yn: common extensions from BSD/SVID/XPG4. Plus the constants INFINITY/NAN. M ext/B/t/concise-xs.t M ext/POSIX/Makefile.PL M ext/POSIX/POSIX.xs M ext/POSIX/lib/POSIX.pm M ext/POSIX/t/export.t M ext/POSIX/t/posix.t commit 2acc0aed480655ff8b8a3449a6b23cd9a155f50c Author: Jarkko Hietaniemi <[email protected]> Date: Wed Aug 27 20:33:55 2014 -0400 POSIX math: Add M_ constants like M_PI. M ext/POSIX/Makefile.PL M ext/POSIX/lib/POSIX.pm M ext/POSIX/t/export.t M ext/POSIX/t/posix.t ----------------------------------------------------------------------- Summary of changes: Configure | 36 ++ Cross/config.sh-arm-linux | 6 + NetWare/config.wc | 6 + Porting/Glossary | 22 + Porting/config.sh | 6 + config_h.SH | 38 ++ configure.com | 10 + ext/B/t/concise-xs.t | 16 +- ext/POSIX/Makefile.PL | 22 +- ext/POSIX/POSIX.xs | 1149 ++++++++++++++++++++++++++++++++++++++++++++- ext/POSIX/lib/POSIX.pm | 18 +- ext/POSIX/t/export.t | 170 ++++--- ext/POSIX/t/math.t | 74 +++ perl.h | 2 +- plan9/config_sh.sample | 6 + symbian/config.sh | 6 + uconfig.h | 42 +- uconfig.sh | 6 + uconfig64.sh | 6 + win32/config.ce | 6 + win32/config.gc | 6 + win32/config.vc | 6 + 22 files changed, 1556 insertions(+), 103 deletions(-) diff --git a/Configure b/Configure index eac67ea..caf8698 100755 --- a/Configure +++ b/Configure @@ -372,6 +372,7 @@ cppstdin='' d__fwalk='' d_access='' d_accessx='' +d_acosh='' d_aintl='' d_alarm='' asctime_r_proto='' @@ -461,6 +462,7 @@ d_fcntl_can_lock='' d_fd_macros='' d_fd_set='' d_fds_bits='' +d_fegetround='' d_fgetpos='' d_finite='' d_finitel='' @@ -474,6 +476,7 @@ d_fp_classl='' d_fpclass='' d_fpclassify='' d_fpclassl='' +d_fpgetround='' d_fpos64_t='' d_frexpl='' d_fs_data_s='' @@ -586,6 +589,8 @@ d_isinf='' d_isinfl='' d_isnan='' d_isnanl='' +d_j0='' +d_j0l='' d_killpg='' d_lchown='' d_ldbl_dig='' @@ -908,6 +913,7 @@ i_dirent='' i_dlfcn='' i_execinfo='' i_fcntl='' +i_fenv='' i_float='' i_fp='' i_fp_class='' @@ -6754,6 +6760,10 @@ EOCP esac $rm_try +: see if this is a fenv.h system +set fenv.h i_fenv +eval $inhdr + : see if this is a float.h system set float.h i_float eval $inhdr @@ -10339,6 +10349,10 @@ $rm -f access* set accessx d_accessx eval $inlibc +: see if acosh exists +set acosh d_acosh +eval $inlibc + : see if aintl exists set aintl d_aintl eval $inlibc @@ -13672,6 +13686,10 @@ EOM fi $rm_try +: see if fegetround exists +set fegetround d_fegetround +eval $inlibc + : see if fgetpos exists set fgetpos d_fgetpos eval $inlibc @@ -13721,6 +13739,10 @@ eval $inlibc set fpclassl d_fpclassl eval $inlibc +: see if fpgetround exists +set fpgetround d_fpgetround +eval $inlibc + : check for fpos64_t echo " " echo "Checking to see if you have fpos64_t..." >&4 @@ -15462,6 +15484,14 @@ eval $inlibc set isnanl d_isnanl eval $inlibc +: see if j0 exists +set j0 d_j0 +eval $inlibc + +: see if j0l exists +set j0l d_j0l +eval $inlibc + : see if killpg exists set killpg d_killpg eval $inlibc @@ -23222,6 +23252,7 @@ d_SCNfldbl='$d_SCNfldbl' d__fwalk='$d__fwalk' d_access='$d_access' d_accessx='$d_accessx' +d_acosh='$d_acosh' d_aintl='$d_aintl' d_alarm='$d_alarm' d_archlib='$d_archlib' @@ -23307,6 +23338,7 @@ d_fcntl_can_lock='$d_fcntl_can_lock' d_fd_macros='$d_fd_macros' d_fd_set='$d_fd_set' d_fds_bits='$d_fds_bits' +d_fegetround='$d_fegetround' d_fgetpos='$d_fgetpos' d_finite='$d_finite' d_finitel='$d_finitel' @@ -23321,6 +23353,7 @@ d_fpathconf='$d_fpathconf' d_fpclass='$d_fpclass' d_fpclassify='$d_fpclassify' d_fpclassl='$d_fpclassl' +d_fpgetround='$d_fpgetround' d_fpos64_t='$d_fpos64_t' d_frexpl='$d_frexpl' d_fs_data_s='$d_fs_data_s' @@ -23417,6 +23450,8 @@ d_isinf='$d_isinf' d_isinfl='$d_isinfl' d_isnan='$d_isnan' d_isnanl='$d_isnanl' +d_j0='$d_j0' +d_j0l='$d_j0l' d_killpg='$d_killpg' d_lchown='$d_lchown' d_ldbl_dig='$d_ldbl_dig' @@ -23780,6 +23815,7 @@ i_dirent='$i_dirent' i_dlfcn='$i_dlfcn' i_execinfo='$i_execinfo' i_fcntl='$i_fcntl' +i_fenv='$i_fenv' i_float='$i_float' i_fp='$i_fp' i_fp_class='$i_fp_class' diff --git a/Cross/config.sh-arm-linux b/Cross/config.sh-arm-linux index da74cf0..cd0721f 100644 --- a/Cross/config.sh-arm-linux +++ b/Cross/config.sh-arm-linux @@ -106,6 +106,7 @@ d_SCNfldbl='define' d__fwalk='undef' d_access='define' d_accessx='undef' +d_acosh='define' d_aintl='undef' d_alarm='define' d_archlib='define' @@ -191,6 +192,7 @@ d_fcntl_can_lock='define' d_fd_macros='define' d_fd_set='define' d_fds_bits='undef' +d_fegetround='define' d_fgetpos='define' d_finite='define' d_finitel='define' @@ -205,6 +207,7 @@ d_fpathconf='define' d_fpclass='undef' d_fpclassify='undef' d_fpclassl='undef' +d_fpgetround='undef' d_fpos64_t='undef' d_frexpl='define' d_fs_data_s='undef' @@ -301,6 +304,8 @@ d_isinf='define' d_isinfl='define' d_isnan='define' d_isnanl='define' +d_j0='define' +d_j0l='define' d_killpg='define' d_lchown='define' d_ldbl_dig='define' @@ -658,6 +663,7 @@ i_dirent='define' i_dlfcn='define' i_execinfo='undef' i_fcntl='undef' +i_fenv='define' i_float='define' i_fp='undef' i_fp_class='undef' diff --git a/NetWare/config.wc b/NetWare/config.wc index 1fc3b98..4b5b48b 100644 --- a/NetWare/config.wc +++ b/NetWare/config.wc @@ -93,6 +93,7 @@ d_SCNfldbl='undef' d__fwalk='undef' d_access='define' d_accessx='undef' +d_acosh='undef' d_aintl='undef' d_alarm='undef' d_archlib='define' @@ -179,6 +180,7 @@ d_fcntl_can_lock='undef' d_fd_macros='define' d_fd_set='define' d_fds_bits='define' +d_fegetround='undef' d_fgetpos='define' d_finite='undef' d_finitel='undef' @@ -193,6 +195,7 @@ d_fpathconf='undef' d_fpclass='undef' d_fpclassify='undef' d_fpclassl='undef' +d_fpgetround='undef' d_fpos64_t='undef' d_frexpl='undef' d_fs_data_s='undef' @@ -290,6 +293,8 @@ d_isinf='undef' d_isinfl='undef' d_isnan='undef' d_isnanl='undef' +d_j0='undef' +d_j0l='undef' d_killpg='undef' d_lchown='undef' d_ldbl_dig='define' @@ -640,6 +645,7 @@ i_dirent='define' i_dlfcn='define' i_execinfo='undef' i_fcntl='define' +i_fenv='undef' i_float='define' i_fp='undef' i_fp_class='undef' diff --git a/Porting/Glossary b/Porting/Glossary index 4b4cc1b..9847c83 100644 --- a/Porting/Glossary +++ b/Porting/Glossary @@ -405,6 +405,10 @@ d_accessx (d_accessx.U): This variable conditionally defines the HAS_ACCESSX symbol, which indicates to the C program that the accessx() routine is available. +d_acosh (d_acosh.U): + This variable conditionally defines the HAS_ACOSH symbol, which + indicates to the C program that the acosh() routine is available. + d_aintl (d_aintl.U): This variable conditionally defines the HAS_AINTL symbol, which indicates to the C program that the aintl() routine is available. @@ -804,6 +808,10 @@ d_fds_bits (d_fd_set.U): a half-fast job and neglected to provide the macros to manipulate an fd_set, HAS_FDS_BITS will let us know how to fix the gaffe. +d_fegetround (d_fegetround.U): + This variable conditionally defines HAS_FEGETROUND if fegetround() is + available to get the floating point rounding mode. + d_fgetpos (d_fgetpos.U): This variable conditionally defines HAS_FGETPOS if fgetpos() is available to get the file position indicator. @@ -864,6 +872,10 @@ d_fpclassl (d_fpclassl.U): This variable conditionally defines the HAS_FPCLASSL symbol, which indicates to the C program that the fpclassl() routine is available. +d_fpgetround (d_fpgetround.U): + This variable conditionally defines HAS_FPGETROUND if fpgetround() is + available to get the floating point rounding mode. + d_fpos64_t (d_fpos64_t.U): This symbol will be defined if the C compiler supports fpos64_t. @@ -1337,6 +1349,16 @@ d_isnanl (d_isnanl.U): This variable conditionally defines the HAS_ISNANL symbol, which indicates to the C program that the isnanl() routine is available. +d_j0 (d_j0.U): + + This variable conditionally defines the HAS_J0 symbol, which + indicates to the C program that the j0() routine is available. + +d_j0l (d_j0l.U): + + This variable conditionally defines the HAS_J0L symbol, which + indicates to the C program that the j0l() routine is available. + d_killpg (d_killpg.U): This variable conditionally defines the HAS_KILLPG symbol, which indicates to the C program that the killpg() routine is available diff --git a/Porting/config.sh b/Porting/config.sh index 4521f5b..14c88af 100644 --- a/Porting/config.sh +++ b/Porting/config.sh @@ -115,6 +115,7 @@ d_SCNfldbl='define' d__fwalk='undef' d_access='define' d_accessx='undef' +d_acosh='undef' d_aintl='undef' d_alarm='define' d_archlib='define' @@ -200,6 +201,7 @@ d_fcntl_can_lock='define' d_fd_macros='define' d_fd_set='define' d_fds_bits='undef' +d_fegetround='undef' d_fgetpos='define' d_finite='define' d_finitel='define' @@ -214,6 +216,7 @@ d_fpathconf='define' d_fpclass='undef' d_fpclassify='undef' d_fpclassl='undef' +d_fpgetround='undef' d_fpos64_t='undef' d_frexpl='define' d_fs_data_s='undef' @@ -310,6 +313,8 @@ d_isinf='define' d_isinfl='undef' d_isnan='define' d_isnanl='define' +d_j0='undef' +d_j0l='undef' d_killpg='define' d_lchown='define' d_ldbl_dig='define' @@ -673,6 +678,7 @@ i_dirent='define' i_dlfcn='define' i_execinfo='undef' i_fcntl='undef' +i_fenv='undef' i_float='define' i_fp='undef' i_fp_class='undef' diff --git a/config_h.SH b/config_h.SH index 30374b7..3c48f93 100755 --- a/config_h.SH +++ b/config_h.SH @@ -162,6 +162,12 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un */ #$d_fcntl HAS_FCNTL /**/ +/* HAS_FEGETROUND: + * This symbol, if defined, indicates that the fegetround routine is + * available to get the floating point rounding mode. + */ +#$d_fegetround HAS_FEGETROUND /**/ + /* HAS_FGETPOS: * This symbol, if defined, indicates that the fgetpos routine is * available to get the file position indicator, similar to ftell(). @@ -242,6 +248,20 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un */ #$d_inetaton HAS_INET_ATON /**/ +/* HAS_J0: + * This symbol, if defined, indicates to the C program that the + * j0() function is available for Bessel functions of the first + * kind of the order zero. + */ +#$d_j0 HAS_J0 /**/ + +/* HAS_J0L: + * This symbol, if defined, indicates to the C program that the + * j0l() function is available for Bessel functions of the first + * kind of the order zero, for long doubles. + */ +#$d_j0l HAS_J0L /**/ + /* HAS_KILLPG: * This symbol, if defined, indicates that the killpg routine is available * to kill process groups. If unavailable, you probably should use kill @@ -694,6 +714,12 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un */ #$i_fcntl I_FCNTL /**/ +/* I_FENV: + * This symbol, if defined, indicates to the C program that it should + * include <fenv.h> to get the floating point environment definitions. + */ +#$i_fenv I_FENV /**/ + /* I_FLOAT: * This symbol, if defined, indicates to the C program that it should * include <float.h> to get definition of symbols like DBL_MAX or @@ -3418,6 +3444,12 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un */ #$d__fwalk HAS__FWALK /**/ +/* HAS_ACOSH: + * This symbol, if defined, indicates that the acosh routine is + * available. + */ +#$d_acosh HAS_ACOSH /**/ + /* HAS_AINTL: * This symbol, if defined, indicates that the aintl routine is * available. If copysignl is also present we can emulate modfl. @@ -3638,6 +3670,12 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un */ #$d_fpclassl HAS_FPCLASSL /**/ +/* HAS_FPGETROUND: + * This symbol, if defined, indicates that the fpgetround routine is + * available to get the floating point rounding mode. + */ +#$d_fpgetround HAS_FPGETROUND /**/ + /* HAS_FPOS64_T: * This symbol will be defined if the C compiler supports fpos64_t. */ diff --git a/configure.com b/configure.com index 001ae8a..56c49f7 100644 --- a/configure.com +++ b/configure.com @@ -3375,10 +3375,14 @@ $ THEN $ d_isnan = "define" $ d_isnanl = "define" $ d_fp_classify = "define" +$ d_j0 = "define" +$ d_acosh = "define" $ ELSE $ d_isnan = "undef" $ d_isnanl = "undef" $ d_fp_classify = "undef" +$ d_j0 = "undef" +$ d_acosh = "undef" $ ENDIF $! $! Now some that we build up @@ -5887,6 +5891,7 @@ $ WC "d_SCNfldbl='" + d_SCNfldbl + "'" $ WC "d__fwalk='undef'" $ WC "d_access='" + d_access + "'" $ WC "d_accessx='undef'" +$ WC "d_acosh='" + d_acosh + "'" $ WC "d_aintl='undef'" $ WC "d_alarm='define'" $ WC "d_archlib='define'" @@ -5969,6 +5974,7 @@ $ WC "d_fcntl_can_lock='" + d_fcntl_can_lock + "'" $ WC "d_fd_set='" + d_fd_set + "'" $ WC "d_fd_macros='define'" $ WC "d_fds_bits='define'" +$ WC "d_fegetround='undef'" $ WC "d_fgetpos='define'" $ IF F$ELEMENT(0, "-", archname) .NES. "VMS_VAX" .AND. use_ieee_math $ THEN @@ -5990,6 +5996,7 @@ $ WC "d_fpathconf='" + d_fpathconf + "'" $ WC "d_fpclass='undef'" $ WC "d_fpclassify='undef'" $ WC "d_fpclassl='undef'" +$ WC "d_fpgetround='undef'" $ WC "d_fpos64_t='" + d_fpos64_t + "'" $ WC "d_frexpl='" + d_frexpl + "'" $ WC "d_fs_data_s='undef'" @@ -6075,6 +6082,8 @@ $ WC "d_isinf='undef'" $ WC "d_isinfl='undef'" $ WC "d_isnan='" + d_isnan + "'" $ WC "d_isnanl='" + d_isnanl + "'" +$ WC "d_j0='" + d_j0 + "'" +$ WC "d_j0l='undef'" $ WC "d_killpg='undef'" $ WC "d_lchown='" + d_lchown + "'" $ WC "d_ldbl_dig='define'" @@ -6407,6 +6416,7 @@ $ WC "i_dirent='undef'" ! we roll our own $ WC "i_dlfcn='undef'" $ WC "i_execinfo='undef'" $ WC "i_fcntl='" + i_fcntl + "'" +$ WC "i_fenv='undef'" $ WC "i_float='define'" $ WC "i_fp='undef'" $ WC "i_fp_class='undef'" diff --git a/ext/B/t/concise-xs.t b/ext/B/t/concise-xs.t index 2944c8e..2a62781 100644 --- a/ext/B/t/concise-xs.t +++ b/ext/B/t/concise-xs.t @@ -190,7 +190,21 @@ my $testpkgs = { qw /WEXITSTATUS WIFEXITED WIFSIGNALED WIFSTOPPED WSTOPSIG WTERMSIG/, 'int_macro_int', # Removed in POSIX 1.16 - 'strtold', # platform varying + + 'strtold', # platform varying (C99) + + qw/fegetround fesetround/, + + # C99 math + qw/acosh asinh atanh cbrt copysign cosh erf + erfc exp2 expm1 fdim fma fmax fmin fpclassify + hypot ilogb isfinite isgreater isgreaterequal + isinf isless islessequal islessgreater isnan + isnormal isunordered j0 j1 jn lgamma log1p + log2 logb lrint nan nearbyint nextafter nexttoward + remainder remquo rint round scalbn signbit + sinh tanh tgamma trunc y0 y1 yn/, + ], perl => [qw/ import croak AUTOLOAD /, $] >= 5.015 diff --git a/ext/POSIX/Makefile.PL b/ext/POSIX/Makefile.PL index 77ebae7..0a39aeb 100644 --- a/ext/POSIX/Makefile.PL +++ b/ext/POSIX/Makefile.PL @@ -12,11 +12,14 @@ if ($Config{sig_name} =~ /\bRTMIN\b/ && $Config{sig_name} =~ /\bRTMAX\b/) { my @libs; if ($^O ne 'MSWin32' && $^O ne 'freemint') { - @libs = ('LIBS' => ["-lm -lposix -lcposix"]); + push @libs, qw(m posix cposix); +} +if ($^O eq 'solaris') { + push @libs, qw(sunmath); } WriteMakefile( NAME => 'POSIX', - @libs, + @libs ? ( 'LIBS' => [ join(" ", map { "-l$_" } @libs) ] ) : (), XSPROTOARG => '-noprototypes', # XXX remove later? VERSION_FROM => 'lib/POSIX.pm', ABSTRACT_FROM => 'lib/POSIX.pod', @@ -88,6 +91,12 @@ END #endif '}); +push @names, + {name=>"INFINITY", type=>"NV", value=>"NV_INF", not_constant=>1}, + {name=>"NAN", type=>"NV", value=>"NV_NAN", not_constant=>1}, + {name=>"Inf", type=>"NV", value=>"NV_INF", not_constant=>1}, + {name=>"NaN", type=>"NV", value=>"NV_NAN", not_constant=>1}; + push @names, {name=>$_, type=>"UV"} foreach (qw(SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK SA_RESETHAND SA_RESTART SA_SIGINFO UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX)); @@ -101,6 +110,15 @@ push @names, {name=>$_, type=>"NV"} FLT_MIN_10_EXP FLT_MIN_EXP FLT_RADIX LDBL_DIG LDBL_MANT_DIG LDBL_MAX_10_EXP LDBL_MAX_EXP LDBL_MIN_10_EXP LDBL_MIN_EXP)); +push @names, {name=>$_, type=>"NV"} + foreach (qw(FP_ILOGB0 FP_ILOGBNAN FP_INFINITE + FP_NAN FP_NORMAL FP_SUBNORMAL FP_ZERO + M_E M_LOG2E M_LOG10E M_LN2 M_PI M_PI_2 + M_PI_4 M_1_PI M_2_PI M_2_SQRT_PI M_SQRT_2 M_SQRT1_2)); + +push @names, {name=>$_, type=>"IV"} + foreach (qw(FE_DOWNWARD FE_TONEAREST FE_TOWARDZERO FE_UPWARD)); + push @names, {name=>$_, type=>"IV", default=>["IV", "0"]} foreach (qw(_POSIX_ARG_MAX _POSIX_CHILD_MAX _POSIX_CHOWN_RESTRICTED _POSIX_LINK_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT _POSIX_NAME_MAX diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 2c20364..12abb3b 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -34,6 +34,9 @@ #ifdef I_FLOAT #include <float.h> #endif +#ifdef I_FENV +#include <fenv.h> +#endif #ifdef I_LIMITS #include <limits.h> #endif @@ -54,6 +57,654 @@ #include <unistd.h> #endif +#ifndef M_E +# define M_E 2.71828182845904523536028747135266250 +#endif +#ifndef M_LOG2E +# define M_LOG2E 1.44269504088896340735992468100189214 +#endif +#ifndef M_LOG10E +# define M_LOG10E 0.434294481903251827651128918916605082 +#endif +#ifndef M_LN2 +# define M_LN2 0.693147180559945309417232121458176568 +#endif +#ifndef M_LN10 +# define M_LN10 2.30258509299404568401799145468436421 +#endif +#ifndef M_PI +# define M_PI 3.14159265358979323846264338327950288 +#endif +#ifndef M_PI_2 +# define M_PI_2 1.57079632679489661923132169163975144 +#endif +#ifndef M_PI_4 +# define M_PI_4 0.785398163397448309615660845819875721 +#endif +#ifndef M_1_PI +# define M_1_PI 0.318309886183790671537767526745028724 +#endif +#ifndef M_2_PI +# define M_2_PI 0.636619772367581343075535053490057448 +#endif +#ifndef M_2_SQRTPI +# define M_2_SQRTPI 1.12837916709551257389615890312154517 +#endif +#ifndef M_SQRT2 +# define M_SQRT2 1.41421356237309504880168872420969808 +#endif +#ifndef M_SQRT1_2 +# define M_SQRT1_2 0.707106781186547524400844362104849039 +#endif + +#if !defined(INFINITY) && defined(NV_INF) +# define INFINITY NV_INF +#endif + +#if !defined(NAN) && defined(NV_NAN) +# define NAN NV_NAN +#endif + +#if !defined(Inf) && defined(NV_INF) +# define Inf NV_INF +#endif + +#if !defined(NaN) && defined(NV_NAN) +# define NaN NV_NAN +#endif + +/* We will have an emulation. */ +#if !defined(HAS_FPCLASSIFY) && !defined(FP_INFINITE) +# define FP_INFINITE 0 +# define FP_NAN 1 +# define FP_NORMAL 2 +# define FP_SUBNORMAL 3 +# define FP_ZERO 4 +#endif + +/* C89 math.h: + + acos asin atan atan2 ceil cos cosh exp fabs floor fmod frexp ldexp + log log10 modf pow sin sinh sqrt tan tanh + + * Implemented in core: + + atan2 cos exp log pow sin sqrt + + * Berkeley/SVID extensions: + + j0 j1 jn y0 y1 yn + + * C99 math.h added: + + acosh asinh atanh cbrt copysign cosh erf erfc exp2 expm1 fdim fma + fmax fmin fpclassify hypot ilogb isfinite isgreater isgreaterequal + isinf isless islessequal islessgreater isnan isnormal isunordered + lgamma log1p log2 logb lrint nan nearbyint nextafter nexttoward remainder + remquo rint round scalbn signbit sinh tanh tgamma trunc + + * Configure already (5.21.0) scans for: + + fpclassify isfinite isinf isnan ilogb*l* signbit + +*/ + +/* XXX Add ldiv(), lldiv()? It's C99, but from stdlib.h, not math.h */ + +/* XXX Beware old gamma() -- one cannot know whether that is the + gamma or the log of gamma, that's why the new tgamma and lgamma. */ + +/* XXX The truthiness of acosh() is the canary for all of the + * C99 math. This is very likely wrong, especially in non-UNIX lands + * like Win32 and VMS, but also older UNIXes have issues. For Win32 + * we later do some undefines for these interfaces. + * + * But we are very trying very hard to avoid introducing separate Configure + * symbols for all the 40-ish new math symbols. Especially since the set + * of missing functions doesn't seem to follow any patterns. */ + +#ifdef HAS_ACOSH +# if defined(USE_LONG_DOUBLE) && defined(HAS_ILOGBL) +/* There's already a symbol for ilogbl, we will use its truthiness + * as the canary for all the *l variants being defined. */ +# define c99_acosh acoshl +# define c99_asinh asinhl +# define c99_atanh atanhl +# define c99_cbrt cbrtl +# define c99_copysign copysignl +# define c99_erf erfl +# define c99_erfc erfcl +# define c99_exp2 exp2l +# define c99_expm1 expm1l +# define c99_fdim fdiml +# define c99_fma fmal +# define c99_fmax fmaxl +# define c99_fmin fminl +# define c99_hypot hypotl +# define c99_ilogb ilogbl +# define c99_lgamma gammal +# define c99_log1p log1pl +# define c99_log2 log2l +# define c99_logb logbl +# if defined(USE_64_BIT_INT) && QUADKIND == QUAD_IS_LONG_LONG +# define c99_lrint llrintl +# else +# define c99_lrint lrintl +# endif +# define c99_nan nanl +# define c99_nearbyint nearbyintl +# define c99_nextafter nextafterl +# define c99_nexttoward nexttowardl +# define c99_remainder remainderl +# define c99_remquo remquol +# define c99_rint rintl +# define c99_round roundl +# define c99_scalbn scalbnl +# ifdef HAS_SIGNBIT /* possibly bad assumption */ +# define c99_signbit signbitl +# endif +# define c99_tgamma tgammal +# define c99_trunc truncl +# else +# define c99_acosh acosh +# define c99_asinh asinh +# define c99_atanh atanh +# define c99_cbrt cbrt +# define c99_copysign copysign +# define c99_erf erf +# define c99_erfc erfc +# define c99_exp2 exp2 +# define c99_expm1 expm1 +# define c99_fdim fdim +# define c99_fma fma +# define c99_fmax fmax +# define c99_fmin fmin +# define c99_hypot hypot +# define c99_ilogb ilogb +# define c99_lgamma lgamma +# define c99_log1p log1p +# define c99_log2 log2 +# define c99_logb logb +# if defined(USE_64_BIT_INT) && QUADKIND == QUAD_IS_LONG_LONG +# define c99_lrint llrint +# else +# define c99_lrint lrint +# endif +# define c99_nan nan +# define c99_nearbyint nearbyint +# define c99_nextafter nextafter +# define c99_nexttoward nexttoward +# define c99_remainder remainder +# define c99_remquo remquo +# define c99_rint rint +# define c99_round round +# define c99_scalbn scalbn +/* We already define Perl_signbit in perl.h. */ +# ifdef HAS_SIGNBIT +# define c99_signbit signbit +# endif +# define c99_tgamma tgamma +# define c99_trunc trunc +# endif + +/* Check both the Configure symbol and the macro-ness (like C99 promises). */ +# if defined(HAS_FPCLASSIFY) && defined(fpclassify) +# define c99_fpclassify fpclassify +# endif +/* Like isnormal(), the isfinite(), isinf(), and isnan() are also C99 + and also (sizeof-arg-aware) macros, but they are already well taken + care of by Configure et al, and defined in perl.h as + Perl_isfinite(), Perl_isinf(), and Perl_isnan(). */ +# ifdef isnormal +# define c99_isnormal isnormal +# endif +# ifdef isgreater /* canary for all the C99 is*<cmp>* macros. */ +# define c99_isgreater isgreater +# define c99_isgreaterequal isgreaterequal +# define c99_isless isless +# define c99_islessequal islessequal +# define c99_islessgreater islessgreater +# define c99_isunordered isunordered +# endif +#endif + +/* If on legacy platforms, and not using gcc, some C99 math interfaces + * might be missing, turn them off so that the emulations hopefully + * kick in. This is admittedly nasty, and fragile, but the alternative + * is to have Configure scans for all the 40+ interfaces. */ +#ifndef __GNUC__ + +/* HP-UX on PA-RISC is missing certain C99 math functions, + * but on IA64 (Integrity) these do exist. */ +# if defined(__hpux) && defined(__hppa) +# undef c99_fma +# undef c99_nexttoward +# undef c99_tgamma +# endif + +# if defined(__irix__) +# undef c99_ilogb +# undef c99_exp2 +# endif + +# if defined(__osf__) /* Tru64 */ +# undef c99_fdim +# undef c99_fma +# undef c99_fmax +# undef c99_fmin +# undef c99_fpclassify +# undef c99_isfinite +# undef c99_isinf +# undef c99_isunordered +# undef c99_lrint +# undef c99_nearbyint +# undef c99_nexttoward +# undef c99_remquo +# undef c99_rint +# undef c99_round +# undef c99_scalbn +# endif + +#endif + +/* XXX Regarding C99 math.h, Win32 seems to be missing these: + + exp2 fdim fma fmax fmin fpclassify ilogb lgamma log1p log2 lrint + remquo rint signbit tgamma trunc + + Win32 does seem to have these: + + acosh asinh atanh cbrt copysign cosh erf erfc expm1 hypot log10 nan + nearbyint nextafter nexttoward remainder round scalbn + + And the Bessel functions are defined like _this. +*/ + +#ifdef WIN32 +# undef c99_exp2 +# undef c99_fdim +# undef c99_fma +# undef c99_fmax +# undef c99_fmin +# undef c99_ilogb +# undef c99_lgamma +# undef c99_log1p +# undef c99_log2 +# undef c99_lrint +# undef c99_remquo +# undef c99_rint +# undef c99_signbit +# undef c99_tgamma +# undef c99_trunc + +/* Some APIs exist under Win32 with "underbar" names. */ +# undef c99_hypot +# undef c99_logb +# undef c99_nextafter +# define c99_hypot _hypot +# define c99_logb _logb +# define c99_nextafter _nextafter + +# define bessel_j0 _j0 +# define bessel_j1 _j1 +# define bessel_jn _jn +# define bessel_y0 _y0 +# define bessel_y1 _y1 +# define bessel_yn _yn + +#endif + +/* The Bessel functions: BSD, SVID, XPG4, and POSIX. But not C99. */ +#ifdef HAS_J0 +# if defined(USE_LONG_DOUBLE) && defined(HAS_J0L) +# define bessel_j0 j0l +# define bessel_j1 j1l +# define bessel_jn jnl +# define bessel_y0 y0l +# define bessel_y1 y1l +# define bessel_yn ynl +# else +# define bessel_j0 j0 +# define bessel_j1 j1 +# define bessel_jn jn +# define bessel_y0 y0 +# define bessel_y1 y1 +# define bessel_yn yn +# endif +#endif + +/* Emulations for missing math APIs. + * + * Keep in mind that the point of many of these functions is that + * they, if available, are supposed to give more precise/more + * numerically stable results. + * + * See e.g. http://www.johndcook.com/math_h.html + */ + +#ifndef c99_acosh +static NV my_acosh(NV x) +{ + return Perl_log(x + Perl_sqrt(x * x - 1)); +} +# define c99_acosh my_acosh +#endif + +#ifndef c99_asinh +static NV my_asinh(NV x) +{ + return Perl_log(x + Perl_sqrt(x * x + 1)); +} +# define c99_asinh my_asinh +#endif + +#ifndef c99_atanh +static NV my_atanh(NV x) +{ + return (Perl_log(1 + x) - Perl_log(1 - x)) / 2; +} +# define c99_atanh my_atanh +#endif + +#ifndef c99_cbrt +static NV my_cbrt(NV x) +{ + static const NV one_third = (NV)1.0/3; + return x >= 0.0 ? Perl_pow(x, one_third) : -Perl_pow(-x, one_third); +} +# define c99_cbrt my_cbrt +#endif + +#ifndef c99_copysign +static NV my_copysign(NV x, NV y) +{ + return y >= 0 ? (x < 0 ? -x : x) : (x < 0 ? x : -x); +} +# define c99_copysign my_copysign +#endif + +/* XXX cosh (though c89) */ + +/* XXX erf -- non-trivial */ +/* XXX erfc -- non-trivial */ + +#ifndef c99_exp2 +static NV my_exp2(NV x) +{ + return Perl_pow((NV)2.0, x); +} +# define c99_exp2 my_exp2 +#endif + +#ifndef c99_expm1 +static NV my_expm1(NV x) +{ + if (PERL_ABS(x) < 1e-5) + /* Probably not enough for long doubles. */ + return x * (1.0 + x * (0.5 + x / 6.0)); /* Taylor series */ + else + return Perl_exp(x) - 1; +} +# define c99_expm1 my_expm1 +#endif + +#ifndef c99_fdim +static NV my_fdim(NV x, NV y) +{ + return x > y ? x - y : 0; +} +# define c99_fdim my_fdim +#endif + +#ifndef c99_fmax +static NV my_fmax(NV x, NV y) +{ + if (Perl_isnan(x)) { + return Perl_isnan(y) ? NV_NAN : y; + } else if (Perl_isnan(y)) { + return x; + } + return x > y ? x : y; +} +# define c99_fmax my_fmax +#endif + +#ifndef c99_fmin +static NV my_fmin(NV x, NV y) +{ + if (Perl_isnan(x)) { + return Perl_isnan(y) ? NV_NAN : y; + } else if (Perl_isnan(y)) { + return x; + } + return x < y ? x : y; +} +# define c99_fmin my_fmin +#endif + +#if !(defined(HAS_FPCLASSIFY) && defined(FP_INFINITE)) +static NV my_fpclassify(NV x) +{ +#if defined(HAS_FPCLASSIFY) && defined(FP_PLUS_INF) + switch (Perl_fp_class(x)) { + case FP_PLUS_INF: case FP_MINUS_INF: return FP_INFINITE; + case FP_SNAN: case FP_QNAN: return FP_NAN; + case FP_PLUS_NORM: case FP_MINUS_NORM: return FP_NORMAL; + case FP_PLUS_DENORM: case FP_MINUS_DENORM: return FP_SUBNORMAL; + case FP_PLUS_ZERO: case FP_MINUS_PZERO: return FP_ZERO; + default: return -1; + } +# define c99_fpclassify my_fpclassify +#elif (defined(HAS_FPCLASS) || defined(HAS_FPCLASSL)) && defined(FP_CLASS_SNAN) + switch (Perl_fp_class(x)) { + case FP_CLASS_NINF: case FP_CLASS_PINF: return FP_INFINITE; + case FP_CLASS_SNAN: case FP_CLASS_QNAN: return FP_NAN; + case FP_CLASS_NNORM: case FP_CLASS_PNORM: return FP_NORMAL; + case FP_CLASS_NDENORM: case FP_CLASS_PDENORM: return FP_SUBNORMAL; + case FP_CLASS_NZERO: case FP_CLASS_PZERO: return FP_ZERO; + default: return -1; + } +# define c99_fpclassify my_fpclassify +#elif (defined(HAS_FPCLASS) || defined(HAS_FP_CLASSL)) && defined(FP_SNAN) + switch (Perl_fp_class(x)) { + case FP_NINF: case FP_PINF: return FP_INFINITE; + case FP_SNAN: case FP_QNAN: return FP_NAN; + case FP_NNORM: case FP_PNORM: return FP_NORMAL; + case FP_NDENORM: case FP_PDENORM: return FP_SUBNORMAL; + case FP_NZERO: case FP_PZERO: return FP_ZERO; + default: return -1; + } +# define c99_fpclassify my_fpclassify +#elif defined(HAS_FP_CLASS) && defined(FP_POS_INF) + switch (Perl_fp_class(x)) { + case FP_NEG_INF: case FP_POS_INF: return FP_INFINITE; + case FP_SNAN: case FP_QNAN: return FP_NAN; + case FP_NEG_NORM: case FP_POS_NORM: return FP_NORMAL; + case FP_NEG_DENORM: case FP_POS_DENORM: return FP_SUBNORMAL; + case FP_NEG_ZERO: case FP_POS_ZERO: return FP_ZERO; + default: return -1; + } +# define c99_fpclassify my_fpclassify +#elif defined(HAS_CLASS) && defined(FP_PLUS_INF) + switch (Perl_fp_class(x)) { + case FP_MINUS_INF: case FP_PLUS_INF: return FP_INFINITE; + case FP_SNAN: case FP_QNAN: return FP_NAN; + case FP_MINUS_NORM: case FP_PLUS_NORM: return FP_NORMAL; + case FP_MINUS_DENORM: case FP_PLUS_DENORM: return FP_SUBNORMAL; + case FP_MINUS_ZERO: case FP_PLUS_ZERO: return FP_ZERO; + default: return -1; + } +# define c99_fpclassify my_fpclassify +#elif defined(HAS_FP_CLASSIFY) + return Perl_fp_class(x); +# define c99_fpclassify my_fpclassify +#elif defined(WIN32) + int fpclass = _fpclass(x); + if (Perl_fp_class_inf(x)) return FP_INFINITE; + if (Perl_fp_class_nan(x)) return FP_NAN; + if (Perl_fp_class_norm(x)) return FP_NORMAL; + if (Perl_fp_class_denorm(x)) return FP_SUBNORMAL; + if (Perl_fp_class_zero(x)) return FP_ZERO; + return -1; +# define c99_fpclassify my_fpclassify +#else + return -1; +#endif +} +#endif + +#ifndef c99_hypot +static NV my_hypot(NV x, NV y) +{ + if (x > 0.0) { + NV t = y / x; + return PERL_ABS(x) * Perl_sqrt(1 + t * t); + } + return NV_NAN; +} +# define c99_hypot my_hypot +#endif + +#ifndef c99_ilogb +static IV my_ilogb(NV x) +{ + return (IV)(Perl_log(x) * M_LOG2E); +} +# define c99_ilogb my_ilogb +#endif + +/* XXX lgamma -- non-trivial */ + +#ifndef c99_log1p +static NV my_log1p(NV x) +{ + if (PERL_ABS(x) > 1e-4) + return Perl_log(1.0 + x); + else + /* Probably not enough for long doubles. */ + return x * (1.0 - x * (-x / 2.0 + x / 3.0)); /* Taylor series */ +} +# define c99_log1p my_log1p +#endif + +#ifndef c99_log2 +static NV my_log2(NV x) +{ + return Perl_log(x) * M_LOG2E; +} +# define c99_log2 my_log2 +#endif + +/* XXX nextafter */ + +/* XXX nexttoward */ + +static int my_fegetround() +{ +#ifdef HAS_FEGETROUND + return fegetround(); +#elif defined(FLT_ROUNDS) + return FLT_ROUNDS; + /* XXX emulate using fpgetround() (HAS_FPGETROUND): + * FP_RN to nearest, FP_RM down, FP_RP, up, FP_RZ truncate */ +#else + return -1; +#endif +} + +static NV my_rint(NV x) +{ +#ifdef FE_TONEAREST + switch (my_fegetround()) { + default: + case FE_TONEAREST: + return (NV)((IV)(x >= 0.0 ? x + 0.5 : x - 0.5)); /* like round() */ + case FE_TOWARDZERO: + return (NV)((IV)(x)); /* like trunc() */ + case FE_DOWNWARD: + return (NV)((IV)(x >= 0.0 ? x : x - 0.5)); + case FE_UPWARD: + return (NV)((IV)(x >= 0.0 ? x + 0.5 : x)); + } +#else + /* XXX emulate using fpsetround() (HAS_FPGETROUND): + * FP_RN to nearest, FP_RM down, FP_RP, up, FP_RZ truncate */ + return NV_NAN; +#endif +} + +/* XXX nearbyint() and rint() are not really identical -- but the difference + * is messy: nearbyint is defined NOT to raise FE_INEXACT floating point + * exceptions, while rint() is defined to MAYBE raise them. At the moment + * Perl is blissfully unaware of such fine detail of floating point. */ +#ifndef c99_nearbyint +# ifdef FE_TONEAREST +# define c99_nearbyrint my_rint +# endif +#endif + +#ifndef c99_lrint +# ifdef FE_TONEAREST +static IV lrint(NV x) +{ + return (IV)my_rint(x); +} +# define c99_lrint my_lrint +# endif +#endif + +/* XXX remainder */ + +/* XXX remquo */ + +#ifndef c99_rint +# ifdef FE_TONEAREST +# define c99_rint my_rint +# endif +#endif + +#ifndef c99_round +static NV my_round(NV x) +{ + return (NV)((IV)(x >= 0.0 ? x + 0.5 : x - 0.5)); +} +# define c99_round my_round +#endif + +#ifndef c99_scalbn +# if defined(Perl_ldexpl) && FLT_RADIX == 2 +static NV my_scalbn(NV x) +{ + return Perl_ldexp(x, y); +} +# define c99_scalbn my_scalbn +# endif +#endif + +/* XXX sinh (though c89) */ + +#ifndef c99_tgamma +# ifdef c99_lgamma +static NV my_tgamma(NV x) +{ + double l = c99_lgamma(x); + return signgam * Perl_exp(l); /* XXX evil global signgam, need lgamma_r */ +} +# define c99_tgamma my_tgamma +/* XXX tgamma without lgamma -- non-trivial */ +# endif +#endif + +/* XXX tanh (though c89) */ + +#ifndef c99_trunc +static NV my_trunc(NV x) +{ + return (NV)((IV)(x)); +} +# define c99_trunc my_trunc +#endif + /* XXX This comment is just to make I_TERMIO and I_SGTTY visible to metaconfig for future extension writers. We don't use them in POSIX. (This is really sneaky :-) --AD @@ -1097,54 +1748,429 @@ NV acos(x) NV x ALIAS: - asin = 1 - atan = 2 - ceil = 3 - cosh = 4 - floor = 5 - log10 = 6 - sinh = 7 - tan = 8 - tanh = 9 + acosh = 1 + asin = 2 + asinh = 3 + atan = 4 + atanh = 5 + cbrt = 6 + ceil = 7 + cosh = 8 + erf = 9 + erfc = 10 + exp2 = 11 + expm1 = 12 + floor = 13 + j0 = 14 + j1 = 15 + lgamma = 16 + log10 = 17 + log1p = 18 + log2 = 19 + logb = 20 + nearbyint = 21 + rint = 22 + round = 23 + sinh = 24 + tan = 25 + tanh = 26 + tgamma = 27 + trunc = 28 + y0 = 29 + y1 = 30 CODE: switch (ix) { case 0: - RETVAL = acos(x); + RETVAL = acos(x); /* C89 math */ break; case 1: - RETVAL = asin(x); +#ifdef c99_acosh + RETVAL = c99_acosh(x); +#else + not_here("acosh"); +#endif break; case 2: - RETVAL = atan(x); + RETVAL = asin(x); /* C89 math */ break; case 3: - RETVAL = ceil(x); +#ifdef c99_asinh + RETVAL = c99_asinh(x); +#else + not_here("asinh"); +#endif break; case 4: - RETVAL = cosh(x); + RETVAL = atan(x); /* C89 math */ break; case 5: - RETVAL = floor(x); +#ifdef c99_atanh + RETVAL = c99_atanh(x); +#else + not_here("atanh"); +#endif break; case 6: - RETVAL = log10(x); +#ifdef c99_cbrt + RETVAL = c99_cbrt(x); +#else + not_here("cbrt"); +#endif break; case 7: - RETVAL = sinh(x); + RETVAL = ceil(x); /* C89 math */ break; case 8: - RETVAL = tan(x); + RETVAL = cosh(x); /* C89 math */ + break; + case 9: +#ifdef c99_erf + RETVAL = c99_erf(x); +#else + not_here("erf"); +#endif + break; + case 10: +#ifdef c99_erfc + RETVAL = erfc(x); +#else + not_here("erfc"); +#endif break; + case 11: +#ifdef c99_exp2 + RETVAL = c99_exp2(x); +#else + not_here("exp2"); +#endif + break; + case 12: +#ifdef c99_expm1 + RETVAL = c99_expm1(x); +#else + not_here("expm1"); +#endif + break; + case 13: + RETVAL = floor(x); /* C89 math */ + break; + case 14: +#ifdef bessel_j0 + RETVAL = bessel_j0(x); +#else + not_here("j0"); +#endif + break; + case 15: +#ifdef bessel_j1 + RETVAL = bessel_j1(x); +#else + not_here("j1"); +#endif + break; + case 16: + /* XXX lgamma_r */ +#ifdef c99_lgamma + RETVAL = c99_lgamma(x); +#else + not_here("lgamma"); +#endif + break; + case 17: + RETVAL = log10(x); /* C89 math */ + break; + case 18: +#ifdef c99_log1p + RETVAL = c99_log1p(x); +#else + not_here("log1p"); +#endif + break; + case 19: +#ifdef c99_log2 + RETVAL = c99_log2(x); +#else + not_here("log2"); +#endif + break; + case 20: +#ifdef c99_logb + RETVAL = c99_logb(x); +#else + not_here("logb"); +#endif + break; + case 21: +#ifdef c99_nearbyint + RETVAL = c99_nearbyint(x); +#else + not_here("nearbyint"); +#endif + break; + case 22: +#ifdef c99_rint + RETVAL = c99_rint(x); +#else + not_here("rint"); +#endif + break; + case 23: +#ifdef c99_round + RETVAL = c99_round(x); +#else + not_here("round"); +#endif + break; + case 24: + RETVAL = sinh(x); /* C89 math */ + break; + case 25: + RETVAL = tan(x); /* C89 math */ + break; + case 26: + RETVAL = tanh(x); /* C89 math */ + break; + case 27: + /* XXX tgamma_r */ +#ifdef c99_tgamma + RETVAL = c99_tgamma(x); +#else + not_here("tgamma"); +#endif + break; + case 28: +#ifdef c99_trunc + RETVAL = c99_trunc(x); +#else + not_here("trunc"); +#endif + break; + case 29: +#ifdef bessel_y0 + RETVAL = bessel_y0(x); +#else + not_here("y0"); +#endif + break; + case 30: default: - RETVAL = tanh(x); +#ifdef bessel_y1 + RETVAL = bessel_y1(x); +#else + not_here("y1"); +#endif + } + OUTPUT: + RETVAL + +IV +fegetround() + CODE: + RETVAL = my_fegetround(); +#ifndef HAS_FEGETROUND + not_here("fegetround"); +#endif + OUTPUT: + RETVAL + +IV +fesetround(x) + IV x + CODE: +#ifdef HAS_FEGETROUND /* canary for fesetround */ + RETVAL = fesetround(x); +#else + not_here("fesetround"); +#endif + OUTPUT: + RETVAL + +IV +fpclassify(x) + NV x + ALIAS: + ilogb = 1 + isfinite = 2 + isinf = 3 + isnan = 4 + isnormal = 5 + lrint = 6 + signbit = 7 + CODE: + switch (ix) { + case 0: +#ifdef c99_fpclassify + RETVAL = c99_fpclassify(x); +#else + not_here("fpclassify"); +#endif + break; + case 1: +#ifdef c99_ilogb + RETVAL = c99_ilogb(x); +#else + not_here("ilogb"); +#endif + break; + case 2: + RETVAL = Perl_isfinite(x); + break; + case 3: + RETVAL = Perl_isinf(x); + break; + case 4: + RETVAL = Perl_isnan(x); + break; + case 5: +#ifdef c99_isnormal + RETVAL = c99_isnormal(x); +#else + not_here("isnormal"); +#endif + break; + case 6: +#ifdef c99_lrint + RETVAL = c99_lrint(x); +#else + not_here("lrint"); +#endif + break; + case 7: + default: +#ifdef Perl_signbit + RETVAL = Perl_signbit(x); +#endif + break; } OUTPUT: RETVAL NV -fmod(x,y) +copysign(x,y) NV x NV y + ALIAS: + fdim = 1 + fmax = 2 + fmin = 3 + fmod = 4 + hypot = 5 + isgreater = 6 + isgreaterequal = 7 + isless = 8 + islessequal = 9 + islessgreater = 10 + isunordered = 11 + nextafter = 12 + nexttoward = 13 + remainder = 14 + CODE: + switch (ix) { + case 0: +#ifdef c99_copysign + RETVAL = c99_copysign(x, y); +#else + not_here("copysign"); +#endif + break; + case 1: +#ifdef c99_fdim + RETVAL = c99_fdim(x, y); +#else + not_here("fdim"); +#endif + break; + case 2: +#ifdef c99_fmax + RETVAL = c99_fmax(x, y); +#else + not_here("fmax"); +#endif + break; + case 3: +#ifdef c99_fmin + RETVAL = c99_fmin(x, y); +#else + not_here("fmin"); +#endif + break; + case 4: + RETVAL = fmod(x, y); /* C89 math */ + break; + case 5: +#ifdef c99_hypot + RETVAL = c99_hypot(x, y); +#else + not_here("hypot"); +#endif + break; + case 6: +#ifdef c99_isgreater + RETVAL = c99_isgreater(x, y); +#else + not_here("isgreater"); +#endif + break; + case 7: +#ifdef c99_isgreaterequal + RETVAL = c99_isgreaterequal(x, y); +#else + not_here("isgreaterequal"); +#endif + break; + case 8: +#ifdef c99_isless + RETVAL = c99_isless(x, y); +#else + not_here("isless"); +#endif + break; + case 9: +#ifdef c99_islessequal + RETVAL = c99_islessequal(x, y); +#else + not_here("islessequal"); +#endif + break; + case 10: +#ifdef c99_islessgreater + RETVAL = c99_islessgreater(x, y); +#else + not_here("islessgreater"); +#endif + break; + case 11: +#ifdef c99_isunordered + RETVAL = c99_isunordered(x, y); +#else + not_here("isunordered"); +#endif + break; + case 12: +#ifdef c99_nextafter + RETVAL = c99_nextafter(x, y); +#else + not_here("nextafter"); +#endif + break; + case 13: +#ifdef c99_nexttoward + RETVAL = c99_nexttoward(x, y); +#else + not_here("nexttoward"); +#endif + break; + case 14: + default: +#ifdef c99_remainder + RETVAL = c99_remainder(x, y); +#else + not_here("remainder"); +#endif + break; + } + OUTPUT: + RETVAL void frexp(x) @@ -1152,7 +2178,7 @@ frexp(x) PPCODE: int expvar; /* (We already know stack is long enough.) */ - PUSHs(sv_2mortal(newSVnv(frexp(x,&expvar)))); + PUSHs(sv_2mortal(newSVnv(Perl_frexp(x,&expvar)))); /* C89 math */ PUSHs(sv_2mortal(newSViv(expvar))); NV @@ -1166,9 +2192,88 @@ modf(x) PPCODE: NV intvar; /* (We already know stack is long enough.) */ - PUSHs(sv_2mortal(newSVnv(Perl_modf(x,&intvar)))); + PUSHs(sv_2mortal(newSVnv(Perl_modf(x,&intvar)))); /* C89 math */ PUSHs(sv_2mortal(newSVnv(intvar))); +void +remquo(x,y) + NV x + NV y + PPCODE: +#ifdef c99_remquo + int intvar; + PUSHs(sv_2mortal(newSVnv(c99_remquo(x,y,&intvar)))); + PUSHs(sv_2mortal(newSVnv(intvar))); +#else + not_here("remquo"); +#endif + +NV +scalbn(x,y) + NV x + IV y + CODE: +#ifdef c99_scalbn + RETVAL = c99_scalbn(x, y); +#else + not_here("scalbn"); +#endif + OUTPUT: + RETVAL + +NV +fma(x,y,z) + NV x + NV y + NV z + CODE: +#ifdef c99_fma + RETVAL = c99_fma(x, y, z); +#else + not_here("fma"); +#endif + OUTPUT: + RETVAL + +NV +nan(s = 0) + char* s; + CODE: +#ifdef c99_nan + RETVAL = c99_nan(s); +#else + not_here("nan"); +#endif + OUTPUT: + RETVAL + +NV +jn(x,y) + IV x + NV y + ALIAS: + yn = 1 + CODE: + switch (ix) { + case 0: +#ifdef bessel_jn + RETVAL = bessel_jn(x, y); +#else + not_here("jn"); +#endif + break; + case 1: + default: +#ifdef bessel_yn + RETVAL = bessel_yn(x, y); +#else + not_here("yn"); +#endif + break; + } + OUTPUT: + RETVAL + SysRet sigaction(sig, optaction, oldaction = 0) int sig diff --git a/ext/POSIX/lib/POSIX.pm b/ext/POSIX/lib/POSIX.pm index 2eb0036..baa99ed 100644 --- a/ext/POSIX/lib/POSIX.pm +++ b/ext/POSIX/lib/POSIX.pm @@ -268,6 +268,9 @@ our %EXPORT_TAGS = ( S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISREG S_ISUID S_IWGRP S_IWOTH S_IWUSR)], + fenv_h => [qw(FE_DOWNWARD FE_TONEAREST FE_TOWARDZERO FE_UPWARD + fegetround fesetround)], + float_h => [qw(DBL_DIG DBL_EPSILON DBL_MANT_DIG DBL_MAX DBL_MAX_10_EXP DBL_MAX_EXP DBL_MIN DBL_MIN_10_EXP DBL_MIN_EXP @@ -296,8 +299,19 @@ our %EXPORT_TAGS = ( LC_MONETARY LC_NUMERIC LC_TIME NULL localeconv setlocale)], - math_h => [qw(HUGE_VAL acos asin atan ceil cosh fabs floor fmod - frexp ldexp log10 modf pow sinh tan tanh)], + math_h => [qw(HUGE_VAL INFINITY Inf FP_ILOGB0 FP_ILOGBNAN FP_INFINITE + FP_NAN FP_NORMAL FP_SUBNORMAL FP_ZERO M_E M_LOG2E + M_LOG10E M_LN2 M_PI M_PI_2 M_PI_4 M_1_PI M_2_PI + M_2_SQRT_PI M_SQRT_2 M_SQRT1_2 NAN NaN acos acosh asin + asinh atan atanh cbrt ceil copysign cosh erf erfc + exp2 expm1 fabs fdim fma fmax fmin floor fmod + fpclassify frexp hypot ilogb isgreater + isgreaterequal isfinite isinf isless islessequal + islessgreater isnan isnormal isunordered j0 j1 jn + ldexp lgamma log10 log1p log2 logb lrint modf nan + nearbyint nextafter nexttoward pow remainder remquo + rint round scalbn signbit sinh tan tanh tgamma trunc + y0 y1 yn)], pwd_h => [], diff --git a/ext/POSIX/t/export.t b/ext/POSIX/t/export.t index afcd097..63a3281 100644 --- a/ext/POSIX/t/export.t +++ b/ext/POSIX/t/export.t @@ -34,80 +34,104 @@ my %expect = ( ERANGE EREMOTE ERESTART EROFS ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESTALE ETIME ETIMEDOUT ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV - EXIT_FAILURE EXIT_SUCCESS FD_CLOEXEC FILENAME_MAX - FLT_DIG FLT_EPSILON FLT_MANT_DIG FLT_MAX FLT_MAX_10_EXP - FLT_MAX_EXP FLT_MIN FLT_MIN_10_EXP FLT_MIN_EXP FLT_RADIX - FLT_ROUNDS F_DUPFD F_GETFD F_GETFL F_GETLK F_OK F_RDLCK - F_SETFD F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK HUGE_VAL - HUPCL ICANON ICRNL IEXTEN IGNBRK IGNCR IGNPAR INLCR INPCK - INT_MAX INT_MIN ISIG ISTRIP IXOFF IXON LC_ALL LC_COLLATE - LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LDBL_DIG - LDBL_EPSILON LDBL_MANT_DIG LDBL_MAX LDBL_MAX_10_EXP - LDBL_MAX_EXP LDBL_MIN LDBL_MIN_10_EXP LDBL_MIN_EXP LINK_MAX - LONG_MAX LONG_MIN L_ctermid L_cuserid L_tmpname MAX_CANON - MAX_INPUT MB_CUR_MAX MB_LEN_MAX NAME_MAX NCCS NDEBUG - NGROUPS_MAX NOFLSH NULL OPEN_MAX OPOST O_ACCMODE O_APPEND - O_CREAT O_EXCL O_NOCTTY O_NONBLOCK O_RDONLY O_RDWR O_TRUNC - O_WRONLY PARENB PARMRK PARODD PATH_MAX PIPE_BUF RAND_MAX R_OK - SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK SA_RESETHAND - SA_RESTART SA_SIGINFO SCHAR_MAX SCHAR_MIN SEEK_CUR SEEK_END - SEEK_SET SHRT_MAX SHRT_MIN SIGABRT SIGALRM SIGBUS SIGCHLD - SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL SIGPIPE SIGPOLL - SIGPROF SIGQUIT SIGRTMAX SIGRTMIN SIGSEGV SIGSTOP SIGSYS - SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU SIGURG SIGUSR1 - SIGUSR2 SIGVTALRM SIGXCPU SIGXFSZ SIG_BLOCK SIG_DFL SIG_ERR - SIG_IGN SIG_SETMASK SIG_UNBLOCK SSIZE_MAX STDERR_FILENO - STDIN_FILENO STDOUT_FILENO STREAM_MAX S_IRGRP S_IROTH S_IRUSR - S_IRWXG S_IRWXO S_IRWXU S_ISBLK S_ISCHR S_ISDIR S_ISFIFO - S_ISGID S_ISREG S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP - S_IXOTH S_IXUSR TCIFLUSH TCIOFF TCIOFLUSH TCION TCOFLUSH - TCOOFF TCOON TCSADRAIN TCSAFLUSH TCSANOW TMP_MAX TOSTOP - TZNAME_MAX UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX VEOF VEOL - VERASE VINTR VKILL VMIN VQUIT VSTART VSTOP VSUSP VTIME - WEXITSTATUS WIFEXITED WIFSIGNALED WIFSTOPPED WNOHANG WSTOPSIG - WTERMSIG WUNTRACED W_OK X_OK _PC_CHOWN_RESTRICTED - _PC_LINK_MAX _PC_MAX_CANON _PC_MAX_INPUT _PC_NAME_MAX - _PC_NO_TRUNC _PC_PATH_MAX _PC_PIPE_BUF _PC_VDISABLE - _POSIX_ARG_MAX _POSIX_CHILD_MAX _POSIX_CHOWN_RESTRICTED - _POSIX_JOB_CONTROL _POSIX_LINK_MAX _POSIX_MAX_CANON - _POSIX_MAX_INPUT _POSIX_NAME_MAX _POSIX_NGROUPS_MAX - _POSIX_NO_TRUNC _POSIX_OPEN_MAX _POSIX_PATH_MAX - _POSIX_PIPE_BUF _POSIX_SAVED_IDS _POSIX_SSIZE_MAX - _POSIX_STREAM_MAX _POSIX_TZNAME_MAX _POSIX_VDISABLE - _POSIX_VERSION _SC_ARG_MAX _SC_CHILD_MAX _SC_CLK_TCK - _SC_JOB_CONTROL _SC_NGROUPS_MAX _SC_OPEN_MAX _SC_PAGESIZE - _SC_SAVED_IDS _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION _exit - abort access acos asctime asin assert atan atexit atof atoi - atol bsearch calloc ceil cfgetispeed cfgetospeed cfsetispeed - cfsetospeed clearerr clock cosh creat ctermid ctime cuserid - difftime div dup dup2 errno execl execle execlp execv execve - execvp fabs fclose fdopen feof ferror fflush fgetc fgetpos - fgets floor fmod fopen fpathconf fprintf fputc fputs fread - free freopen frexp fscanf fseek fsetpos fstat fsync ftell + EXIT_FAILURE EXIT_SUCCESS FD_CLOEXEC + FE_DOWNWARD FE_TONEAREST FE_TOWARDZERO FE_UPWARD + FILENAME_MAX FLT_DIG FLT_EPSILON FLT_MANT_DIG FLT_MAX + FLT_MAX_10_EXP FLT_MAX_EXP FLT_MIN FLT_MIN_10_EXP + FLT_MIN_EXP FLT_RADIX FLT_ROUNDS FP_ILOGB0 + FP_ILOGBNAN FP_INFINITE FP_NAN FP_NORMAL + FP_SUBNORMAL FP_ZERO F_DUPFD F_GETFD F_GETFL F_GETLK + F_OK F_RDLCK F_SETFD F_SETFL F_SETLK F_SETLKW + F_UNLCK F_WRLCK HUGE_VAL HUPCL ICANON ICRNL IEXTEN + IGNBRK IGNCR IGNPAR INFINITY INLCR INPCK INT_MAX + INT_MIN ISIG ISTRIP IXOFF IXON Inf LC_ALL LC_COLLATE + LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME + LDBL_DIG LDBL_EPSILON LDBL_MANT_DIG LDBL_MAX + LDBL_MAX_10_EXP LDBL_MAX_EXP LDBL_MIN + LDBL_MIN_10_EXP LDBL_MIN_EXP LINK_MAX LONG_MAX + LONG_MIN L_ctermid L_cuserid L_tmpname MAX_CANON + MAX_INPUT MB_CUR_MAX MB_LEN_MAX M_1_PI M_2_PI + M_2_SQRT_PI M_E M_LN2 M_LOG10E M_LOG2E M_PI M_PI_2 + M_PI_4 M_SQRT1_2 M_SQRT_2 NAME_MAX NAN NCCS NDEBUG + NGROUPS_MAX NOFLSH NULL NaN OPEN_MAX OPOST O_ACCMODE + O_APPEND O_CREAT O_EXCL O_NOCTTY O_NONBLOCK O_RDONLY + O_RDWR O_TRUNC O_WRONLY PARENB PARMRK PARODD + PATH_MAX PIPE_BUF RAND_MAX R_OK SA_NOCLDSTOP + SA_NOCLDWAIT SA_NODEFER SA_ONSTACK SA_RESETHAND + SA_RESTART SA_SIGINFO SCHAR_MAX SCHAR_MIN SEEK_CUR + SEEK_END SEEK_SET SHRT_MAX SHRT_MIN SIGABRT SIGALRM + SIGBUS SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT + SIGKILL SIGPIPE SIGPOLL SIGPROF SIGQUIT SIGRTMAX + SIGRTMIN SIGSEGV SIGSTOP SIGSYS SIGTERM SIGTRAP + SIGTSTP SIGTTIN SIGTTOU SIGURG SIGUSR1 SIGUSR2 + SIGVTALRM SIGXCPU SIGXFSZ SIG_BLOCK SIG_DFL SIG_ERR + SIG_IGN SIG_SETMASK SIG_UNBLOCK SSIZE_MAX + STDERR_FILENO STDIN_FILENO STDOUT_FILENO STREAM_MAX + S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU + S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISREG + S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH + S_IXUSR TCIFLUSH TCIOFF TCIOFLUSH TCION TCOFLUSH + TCOOFF TCOON TCSADRAIN TCSAFLUSH TCSANOW TMP_MAX + TOSTOP TZNAME_MAX UCHAR_MAX UINT_MAX ULONG_MAX + USHRT_MAX VEOF VEOL VERASE VINTR VKILL VMIN VQUIT + VSTART VSTOP VSUSP VTIME WEXITSTATUS WIFEXITED + WIFSIGNALED WIFSTOPPED WNOHANG WSTOPSIG WTERMSIG + WUNTRACED W_OK X_OK _PC_CHOWN_RESTRICTED + _PC_LINK_MAX _PC_MAX_CANON _PC_MAX_INPUT + _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX _PC_PIPE_BUF + _PC_VDISABLE _POSIX_ARG_MAX _POSIX_CHILD_MAX + _POSIX_CHOWN_RESTRICTED _POSIX_JOB_CONTROL + _POSIX_LINK_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT + _POSIX_NAME_MAX _POSIX_NGROUPS_MAX _POSIX_NO_TRUNC + _POSIX_OPEN_MAX _POSIX_PATH_MAX _POSIX_PIPE_BUF + _POSIX_SAVED_IDS _POSIX_SSIZE_MAX _POSIX_STREAM_MAX + _POSIX_TZNAME_MAX _POSIX_VDISABLE _POSIX_VERSION + _SC_ARG_MAX _SC_CHILD_MAX _SC_CLK_TCK + _SC_JOB_CONTROL _SC_NGROUPS_MAX _SC_OPEN_MAX + _SC_PAGESIZE _SC_SAVED_IDS _SC_STREAM_MAX + _SC_TZNAME_MAX _SC_VERSION _exit abort access acos + acosh asctime asin asinh assert atan atanh atexit + atof atoi atol bsearch calloc cbrt ceil cfgetispeed + cfgetospeed cfsetispeed cfsetospeed clearerr clock + copysign cosh creat ctermid ctime cuserid difftime + div dup dup2 erf erfc errno execl execle execlp + execv execve execvp exp2 expm1 fabs fclose fdim + fdopen fegetround feof ferror fesetround fflush + fgetc fgetpos fgets floor fma fmax fmin fmod fopen + fpathconf fpclassify fprintf fputc fputs fread free + freopen frexp fscanf fseek fsetpos fstat fsync ftell fwrite getchar getcwd getegid getenv geteuid getgid getgroups - getpid gets getuid isalnum isalpha isatty iscntrl isdigit - isgraph islower isprint ispunct isspace isupper isxdigit labs - ldexp ldiv localeconv log10 longjmp lseek malloc mblen - mbstowcs mbtowc memchr memcmp memcpy memmove memset mkfifo - mktime modf offsetof pathconf pause perror pow putc putchar - puts qsort raise realloc remove rewind scanf setbuf setgid - setjmp setlocale setpgid setsid setuid setvbuf sigaction - siglongjmp signal sigpending sigprocmask sigsetjmp sigsuspend - sinh sscanf stderr stdin stdout strcat strchr strcmp strcoll - strcpy strcspn strerror strftime strlen strncat strncmp - strncpy strpbrk strrchr strspn strstr strtod strtok strtol - strtold strtoul strxfrm sysconf tan tanh tcdrain tcflow - tcflush tcgetattr tcgetpgrp tcsendbreak tcsetattr tcsetpgrp - tmpfile tmpnam tolower toupper ttyname tzname tzset uname - ungetc vfprintf vprintf vsprintf wcstombs wctomb)], - EXPORT_OK => [qw(abs alarm atan2 chdir chmod chown close closedir cos exit - exp fcntl fileno fork getc getgrgid getgrnam getlogin - getpgrp getppid getpwnam getpwuid gmtime kill lchown link - localtime log mkdir nice open opendir pipe printf rand - read readdir rename rewinddir rmdir sin sleep sprintf sqrt - srand stat system time times umask unlink utime wait - waitpid write)], -); + getpid gets getuid hypot ilogb isalnum isalpha + isatty iscntrl isdigit isfinite isgraph isgreater + isgreaterequal isinf isless islessequal + islessgreater islower isnan isnormal isprint ispunct + isspace isunordered isupper isxdigit j0 j1 jn labs + ldexp ldiv lgamma localeconv log10 log1p log2 logb + longjmp lrint lseek malloc mblen mbstowcs mbtowc + memchr memcmp memcpy memmove memset mkfifo mktime + modf nan nearbyint nextafter nexttoward offsetof + pathconf pause perror pow putc putchar puts qsort + raise realloc remainder remove remquo rewind rint + round scalbn scanf setbuf setgid setjmp setlocale + setpgid setsid setuid setvbuf sigaction siglongjmp + signal signbit sigpending sigprocmask sigsetjmp + sigsuspend sinh sscanf stderr stdin stdout strcat + strchr strcmp strcoll strcpy strcspn strerror + strftime strlen strncat strncmp strncpy strpbrk + strrchr strspn strstr strtod strtok strtol strtold + strtoul strxfrm sysconf tan tanh tcdrain tcflow + tcflush tcgetattr tcgetpgrp tcsendbreak tcsetattr + tcsetpgrp tgamma tmpfile tmpnam tolower toupper + trunc ttyname tzname tzset uname ungetc vfprintf + vprintf vsprintf wcstombs wctomb y0 y1 yn )], + EXPORT_OK => [qw(abs alarm atan2 chdir chmod chown + close closedir cos exit exp fcntl fileno fork getc + getgrgid getgrnam getlogin getpgrp getppid getpwnam + getpwuid gmtime kill lchown link localtime log mkdir + nice open opendir pipe printf rand read readdir + rename rewinddir rmdir sin sleep sprintf sqrt srand + stat system time times umask unlink utime wait + waitpid write)], ); plan (tests => 2 * keys %expect); diff --git a/ext/POSIX/t/math.t b/ext/POSIX/t/math.t index bf0c2de..c949843 100644 --- a/ext/POSIX/t/math.t +++ b/ext/POSIX/t/math.t @@ -5,6 +5,8 @@ use strict; use POSIX; use Test::More; +use Config; + # These tests are mainly to make sure that these arithmetic functions # exist and are accessible. They are not meant to be an exhaustive # test for the interface. @@ -52,4 +54,76 @@ between(0.76, tanh(1), 0.77, 'tanh(1)'); between(-0.77, tanh(-1), -0.76, 'tanh(-1)'); cmp_ok(tanh(1), '==', -tanh(-1), 'tanh(1) == -tanh(-1)'); **** PATCH TRUNCATED AT 2000 LINES -- 488 NOT SHOWN **** -- Perl5 Master Repository
