In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/d086148c4193252081799d1c5bc16c6cc3f5ae1a?hp=023257bf4912ddb30fcdb73a58bce3d84974b8dc>

- Log -----------------------------------------------------------------
commit d086148c4193252081799d1c5bc16c6cc3f5ae1a
Author: Nicholas Clark <[email protected]>
Date:   Tue Oct 19 13:26:19 2010 +0200

    Stop 'use v5.8' leaking memory. Fixes #78436.
    
    Based on a patch proposed by Niko Tyni.

M       pp_ctl.c

commit 228f83bf2f4cc0f605478d266ed3a2dd48cb7041
Author: Nicholas Clark <[email protected]>
Date:   Tue Oct 19 12:34:20 2010 +0200

    Make Fcntl::AUTOLOAD's error messages consistent with croak() using modules.
    
    Fcntl avoids using Carp::croak(), but its code was adding a full stop at the
    end of all error messages. Other modules are using croak(), which has no 
full
    stop between the line number and the newline.
    
    Add a test for the error messages from Fcntl::AUTOLOAD.

M       MANIFEST
M       ext/Fcntl/Fcntl.pm
A       ext/Fcntl/t/autoload.t

commit 80a649c810fab9a1510e35c012adc454dd4a0a4e
Author: Nicholas Clark <[email protected]>
Date:   Tue Oct 19 12:13:52 2010 +0200

    Fcntl, POSIX and Socket can all use Proxy Constant Subs unconditionally.
    
    Previously each Makefile.PL had conditional code to only use them post 
5.9.2,
    so that the code would not diverge between blead and maint-5.8. That isn't 
an
    important consideration any longer, whereas removing the conditional code 
here
    will allow their AUTOLOAD routines to be simplified.

M       ext/Fcntl/Makefile.PL
M       ext/POSIX/Makefile.PL
M       ext/Socket/Makefile.PL

commit 0eedeed40b39b3e37aa3a674c182ccda0c738aa6
Author: Nicholas Clark <[email protected]>
Date:   Tue Oct 19 11:14:25 2010 +0200

    Improve the generated C code for $xs_subname for Proxy Constant Subroutines.

M       cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm
-----------------------------------------------------------------------

Summary of changes:
 MANIFEST                                           |    1 +
 .../lib/ExtUtils/Constant/ProxySubs.pm             |    9 ++---
 ext/Fcntl/Fcntl.pm                                 |    2 +-
 ext/Fcntl/Makefile.PL                              |    2 +-
 ext/Fcntl/t/autoload.t                             |   32 ++++++++++++++++++++
 ext/POSIX/Makefile.PL                              |    2 +-
 ext/Socket/Makefile.PL                             |    2 +-
 pp_ctl.c                                           |    2 +-
 8 files changed, 42 insertions(+), 10 deletions(-)
 create mode 100644 ext/Fcntl/t/autoload.t

diff --git a/MANIFEST b/MANIFEST
index 15298fa..9c866a4 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -3162,6 +3162,7 @@ ext/Errno/t/Errno.t       See if Errno works
 ext/Fcntl/Fcntl.pm     Fcntl extension Perl module
 ext/Fcntl/Fcntl.xs     Fcntl extension external subroutines
 ext/Fcntl/Makefile.PL  Fcntl extension makefile writer
+ext/Fcntl/t/autoload.t See if Fcntl AUTOLOAD error messages work
 ext/Fcntl/t/fcntl.t    See if Fcntl works
 ext/Fcntl/t/mode.t     See if S_ISREG() and S_ISDIR() work
 ext/Fcntl/t/syslfs.t   See if large files work for sysio
diff --git a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm 
b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm
index 0005f13..1d85abf 100644
--- a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm
+++ b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm
@@ -538,18 +538,17 @@ $xs_subname(sv)
     INPUT:
        SV *            sv;
     PPCODE:
-#ifdef SYMBIAN
-       sv = newSVpvf("%"SVf" is not a valid $package_sprintf_safe macro", sv);
-#else
+#ifndef SYMBIAN
        HV *${c_subname}_missing = get_missing_hash(aTHX);
        if (hv_exists_ent(${c_subname}_missing, sv, 0)) {
            sv = newSVpvf("Your vendor has not defined $package_sprintf_safe 
macro %" SVf
                          ", used", sv);
-       } else {
+       } else
+#endif
+       {
            sv = newSVpvf("%"SVf" is not a valid $package_sprintf_safe macro",
                          sv);
        }
-#endif
        PUSHs(sv_2mortal(sv));
 DONT
 
diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm
index 4aede8c..970735c 100644
--- a/ext/Fcntl/Fcntl.pm
+++ b/ext/Fcntl/Fcntl.pm
@@ -189,7 +189,7 @@ sub AUTOLOAD {
     my ($error, $val) = constant($constname);
     if ($error) {
         my (undef,$file,$line) = caller;
-        die "$error at $file line $line.\n";
+        die "$error at $file line $line\n";
     }
     no strict 'refs';
     *$AUTOLOAD = sub { $val };
diff --git a/ext/Fcntl/Makefile.PL b/ext/Fcntl/Makefile.PL
index 4306789..2bed754 100644
--- a/ext/Fcntl/Makefile.PL
+++ b/ext/Fcntl/Makefile.PL
@@ -39,7 +39,7 @@ my @names = (qw(
             {name=>"SEEK_END", default=>["IV", "2"]},
             {name=>"_S_IFMT", macro=>"S_IFMT", value=>"S_IFMT"});
 WriteConstants(
-    ($] > 5.009002 ? (PROXYSUBS => 1) : ()),
+    PROXYSUBS => 1,
     NAME => 'Fcntl',
     NAMES => \...@names,
 );
diff --git a/ext/Fcntl/t/autoload.t b/ext/Fcntl/t/autoload.t
new file mode 100644
index 0000000..09d089c
--- /dev/null
+++ b/ext/Fcntl/t/autoload.t
@@ -0,0 +1,32 @@
+#!./perl -w
+
+use strict;
+use Test::More;
+
+require Fcntl;
+
+# SEEK_SET intentionally included to test the skip functionality.
+foreach my $symbol (qw(SEEK_SET O_BINARY S_ENFMT)) {
+    my $full_name = "Fcntl::$symbol";
+    if (defined eval $full_name) {
+       foreach my $code ($full_name, "$full_name()") {
+           my $value = eval $code;
+           like ($value, qr/^[0-9]+$/, "$code is defined on this system");
+       }
+    } else {
+       foreach my $code ($full_name, "$full_name()") {
+           my $value = eval $code;
+           like ($@,
+                 qr/^Your vendor has not defined Fcntl macro $symbol, used at 
\(eval [0-9]+\) line 1\n\z/,
+                 "Expected error message for $symbol, not defined on this 
system");
+       }
+    }
+}
+
+my $value = eval 'Fcntl::S_ISPIE()';
+is($value, undef, "Fcntl::S_ISPIE isn't valid");
+like ($@,
+      qr/^S_ISPIE is not a valid Fcntl macro at \(eval [0-9]+\) line 1\n\z/,
+      "Expected error message for S_ISPIE");
+
+done_testing();
diff --git a/ext/POSIX/Makefile.PL b/ext/POSIX/Makefile.PL
index ff04c3e..4a2c08a 100644
--- a/ext/POSIX/Makefile.PL
+++ b/ext/POSIX/Makefile.PL
@@ -119,7 +119,7 @@ if ($rt_signals) {
 }
 
 WriteConstants(
-    ($] > 5.009002 ? (PROXYSUBS => 1) : ()),
+    PROXYSUBS => 1,
     NAME => 'POSIX',
     NAMES => \...@names,
 );
diff --git a/ext/Socket/Makefile.PL b/ext/Socket/Makefile.PL
index 672e226..043f482 100644
--- a/ext/Socket/Makefile.PL
+++ b/ext/Socket/Makefile.PL
@@ -72,7 +72,7 @@ push @names,
          foreach qw(INADDR_ANY INADDR_LOOPBACK INADDR_NONE INADDR_BROADCAST);
 
 WriteConstants(
-    ($] > 5.009002 ? (PROXYSUBS => 1) : ()),
+    PROXYSUBS => 1,
     NAME => 'Socket',
     NAMES => \...@names,
 );
diff --git a/pp_ctl.c b/pp_ctl.c
index a9d92f1..16e7cf9 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3398,7 +3398,7 @@ PP(pp_require)
 
     sv = POPs;
     if ( (SvNIOKp(sv) || SvVOK(sv)) && PL_op->op_type != OP_DOFILE) {
-       sv = new_version(sv);
+       sv = sv_2mortal(new_version(sv));
        if (!sv_derived_from(PL_patchlevel, "version"))
            upg_version(PL_patchlevel, TRUE);
        if (cUNOP->op_first->op_type == OP_CONST && cUNOP->op_first->op_private 
& OPpCONST_NOVER) {

--
Perl5 Master Repository

Reply via email to