In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/0f1abed3702060886f7934560cf68b0d693cb58a?hp=74d5bfab5a03c46777cd031b635f872b88dc1fef>

- Log -----------------------------------------------------------------
commit 0f1abed3702060886f7934560cf68b0d693cb58a
Author: Jarkko Hietaniemi <[email protected]>
Date:   Mon Sep 1 16:26:31 2014 -0400

    HP-UX: more robust (10.X) and verbose test skippage.

M       t/op/infnan.t

commit d11832573a44ef0fa2ab36e6878d975388f9ab92
Author: Jarkko Hietaniemi <[email protected]>
Date:   Mon Sep 1 15:55:15 2014 -0400

    Static initialization using 1/0 or 0/0 not C89.

M       embedvar.h
M       perl.h
M       perlapi.h
M       perlvars.h
-----------------------------------------------------------------------

Summary of changes:
 embedvar.h    |  4 ----
 perl.h        | 10 ++++++++--
 perlapi.h     |  4 ----
 perlvars.h    | 13 -------------
 t/op/infnan.t | 10 ++++++----
 5 files changed, 14 insertions(+), 27 deletions(-)

diff --git a/embedvar.h b/embedvar.h
index 0ae37a1..766880c 100644
--- a/embedvar.h
+++ b/embedvar.h
@@ -375,8 +375,6 @@
 #define PL_Ghash_seed_set      (my_vars->Ghash_seed_set)
 #define PL_hints_mutex         (my_vars->Ghints_mutex)
 #define PL_Ghints_mutex                (my_vars->Ghints_mutex)
-#define PL_infinity            (my_vars->Ginfinity)
-#define PL_Ginfinity           (my_vars->Ginfinity)
 #define PL_keyword_plugin      (my_vars->Gkeyword_plugin)
 #define PL_Gkeyword_plugin     (my_vars->Gkeyword_plugin)
 #define PL_malloc_mutex                (my_vars->Gmalloc_mutex)
@@ -387,8 +385,6 @@
 #define PL_Gmy_ctx_mutex       (my_vars->Gmy_ctx_mutex)
 #define PL_my_cxt_index                (my_vars->Gmy_cxt_index)
 #define PL_Gmy_cxt_index       (my_vars->Gmy_cxt_index)
-#define PL_nan                 (my_vars->Gnan)
-#define PL_Gnan                        (my_vars->Gnan)
 #define PL_op_mutex            (my_vars->Gop_mutex)
 #define PL_Gop_mutex           (my_vars->Gop_mutex)
 #define PL_op_seq              (my_vars->Gop_seq)
diff --git a/perl.h b/perl.h
index 36ecb50..4bd7c92 100644
--- a/perl.h
+++ b/perl.h
@@ -4102,6 +4102,12 @@ END_EXTERN_C
 #  endif
 #endif
 
+/* If you are thinking of using HUGE_VAL for infinity, or using
+ * <math.h> functions to generate NV_INF (e.g. exp(1e9), log(-1.0)),
+ * stop.  Neither will work portably: HUGE_VAL can be just DBL_MAX,
+ * and the math functions might be just generating DBL_MAX, or even
+ * zero.  */
+
 #if !defined(NV_INF) && defined(USE_LONG_DOUBLE) && defined(LDBL_INFINITY)
 #  define NV_INF LDBL_INFINITY
 #endif
@@ -4115,7 +4121,7 @@ END_EXTERN_C
 #  define NV_INF (NV)INF
 #endif
 #if !defined(NV_INF)
-#  define NV_INF (NV)PL_infinity
+#  define NV_INF ((NV)1.0/0.0) /* Some compilers will warn. */
 #endif
 
 #if !defined(NV_NAN) && defined(USE_LONG_DOUBLE)
@@ -4148,7 +4154,7 @@ END_EXTERN_C
 #  define NV_NAN (NV)SNAN
 #endif
 #if !defined(NV_NAN) && defined(NV_INF)
-#  define NV_NAN PL_nan
+#  define NV_NAN ((NV)0.0/0.0) /* Some compilers will warn. */
 #endif
 
 #ifndef __cplusplus
diff --git a/perlapi.h b/perlapi.h
index da48b53..910f789 100644
--- a/perlapi.h
+++ b/perlapi.h
@@ -121,8 +121,6 @@ END_EXTERN_C
 #define PL_hash_seed_set       (*Perl_Ghash_seed_set_ptr(NULL))
 #undef  PL_hints_mutex
 #define PL_hints_mutex         (*Perl_Ghints_mutex_ptr(NULL))
-#undef  PL_infinity
-#define PL_infinity            (*Perl_Ginfinity_ptr(NULL))
 #undef  PL_keyword_plugin
 #define PL_keyword_plugin      (*Perl_Gkeyword_plugin_ptr(NULL))
 #undef  PL_malloc_mutex
@@ -133,8 +131,6 @@ END_EXTERN_C
 #define PL_my_ctx_mutex                (*Perl_Gmy_ctx_mutex_ptr(NULL))
 #undef  PL_my_cxt_index
 #define PL_my_cxt_index                (*Perl_Gmy_cxt_index_ptr(NULL))
-#undef  PL_nan
-#define PL_nan                 (*Perl_Gnan_ptr(NULL))
 #undef  PL_op_mutex
 #define PL_op_mutex            (*Perl_Gop_mutex_ptr(NULL))
 #undef  PL_op_seq
diff --git a/perlvars.h b/perlvars.h
index 40f5072..7bafa40 100644
--- a/perlvars.h
+++ b/perlvars.h
@@ -237,16 +237,3 @@ PERLVAR(G, malloc_mutex, perl_mutex)       /* Mutex for 
malloc */
 
 PERLVARI(G, hash_seed_set, bool, FALSE)        /* perl.c */
 PERLVARA(G, hash_seed, PERL_HASH_SEED_BYTES, unsigned char) /* perl.c and hv.h 
*/
-
-/* The infinity.  Used if no suitable definition is found in <math.h>.
- * Note: many older places (like HP-UX 10.X) define HUGE_VAL
- * as DBL_MAX (or LDBL_MAX for long doubles).  Therefore HUGE_VAL
- * is not a suitable replacement for infinity.
- *
- * The division by zero might warn with some compilers. */
-PERLVARIC(G, infinity, NV, (NV)1.0/0.0)
-
-/* The not-a-number.  Used if no suitable definition is found in <math.h>
- *
- * The division by zero might warn with some compilers. */
-PERLVARIC(G, nan, NV, (NV)0.0/0.0)
diff --git a/t/op/infnan.t b/t/op/infnan.t
index 470b6d4..a7ef27b 100644
--- a/t/op/infnan.t
+++ b/t/op/infnan.t
@@ -101,8 +101,9 @@ SKIP: {
   is(1/$NInf, 0, "one per -Inf is zero");
 
  SKIP: {
-     if ("$^O $Config{osvers}" eq "hpux 10.20") {
-         skip "pow doesn't generate Inf", 1;
+     my $here = "$^O $Config{osvers}";
+     if ($here =~ /^hpux 10/) {
+         skip "$here: pow doesn't generate Inf", 1;
      }
      is(9**9**9, $PInf, "9**9**9 is Inf");
   }
@@ -160,8 +161,9 @@ SKIP: {
   is($NaN * 2, $NaN, "NaN times two is NaN");
 
  SKIP: {
-     if ("$^O $Config{osvers}" eq "hpux 10.20") {
-         skip "pow doesn't generate Inf, so sin(Inf) won't happen", 1;
+     my $here = "$^O $Config{osvers}";
+     if ($here =~ /^hpux 10/) {
+         skip "$here: pow doesn't generate Inf, so sin(Inf) won't happen", 1;
      }
      is(sin(9**9**9), $NaN, "sin(9**9**9) is NaN");
   }

--
Perl5 Master Repository

Reply via email to