Front page | perl.perl5.changes |
Postings from May 2008
Change 33953: Integrate:
From:
Dave Mitchell
Date:
May 30, 2008 16:15
Subject:
Change 33953: Integrate:
Change 33953 by davem@davem-pigeon on 2008/05/30 23:12:33
Integrate:
[ 33789]
Subject: [PATCH] Documentation typo fix for mro.
From: Florian Ragwitz <rafl@debian.org>
Date: Sun, 4 May 2008 17:40:05 +0200
Message-Id: <1209915605-11248-1-git-send-email-rafl@debian.org>
[ 33791]
Subject: [PATCH] extra tests for t/op/range.t (was Re: [perl #53554] Range
From: Bram <p5p@perl.wizbit.be>
Date: Mon, 05 May 2008 20:03:32 +0200
Message-ID: <20080505200332.pke1i5vu7gos8kc0@horde.wizbit.be>
[ 33792]
Subject: [PATCH] -Uusedl on cygwin
From: Reini Urban <rurban@x-ray.at>
Date: Mon, 05 May 2008 20:34:13 +0200
Message-ID: <481F5325.5090907@x-ray.at>
[ 33815]
Subject: [PATCH] Call SvMAGICAL_off in mg_free
From: Bram <p5p@perl.wizbit.be>
Date: Mon, 05 May 2008 16:18:56 +0200
Message-ID: <20080505161856.pgz4pjga1w44ksk4@horde.wizbit.be>
[ 33822]
Subject: [PATCH] Handle PL_minus_E before PL_minus_{n,p}.
From: Florian Ragwitz <rafl@debian.org>
Date: Sun, 11 May 2008 07:51:18 +0200
Message-Id: <1210485078-19640-1-git-send-email-rafl@debian.org>
Affected files ...
... //depot/maint-5.10/perl/ext/Win32CORE/Makefile.PL#2 integrate
... //depot/maint-5.10/perl/ext/Win32CORE/Win32CORE.c#2 integrate
... //depot/maint-5.10/perl/lib/mro.pm#2 integrate
... //depot/maint-5.10/perl/mg.c#12 integrate
... //depot/maint-5.10/perl/sv.c#18 integrate
... //depot/maint-5.10/perl/t/op/range.t#3 integrate
... //depot/maint-5.10/perl/t/run/switches.t#3 integrate
... //depot/maint-5.10/perl/toke.c#7 integrate
Differences ...
==== //depot/maint-5.10/perl/ext/Win32CORE/Makefile.PL#2 (text) ====
Index: perl/ext/Win32CORE/Makefile.PL
--- perl/ext/Win32CORE/Makefile.PL#1~32694~ 2007-12-22 01:23:09.000000000 -0800
+++ perl/ext/Win32CORE/Makefile.PL 2008-05-30 16:12:33.000000000 -0700
@@ -4,3 +4,15 @@
'NAME' => 'Win32CORE',
'VERSION_FROM' => 'Win32CORE.pm',
);
+
+# undef USEIMPORTLIB for static compilation
+sub MY::cflags {
+ package MY; # so that "SUPER" works right
+ my ($self, $libperl)=@_;
+ return '' unless $self->needs_linking();
+ my $base = $self->SUPER::cflags($libperl);
+ if ($self->{LINKTYPE} eq 'static') {
+ $base =~ s/CCFLAGS =(.*)$/CCFLAGS =\1 -UUSEIMPORTLIB /m;
+ }
+ return $base;
+}
==== //depot/maint-5.10/perl/ext/Win32CORE/Win32CORE.c#2 (text) ====
Index: perl/ext/Win32CORE/Win32CORE.c
--- perl/ext/Win32CORE/Win32CORE.c#1~32694~ 2007-12-22 01:23:09.000000000 -0800
+++ perl/ext/Win32CORE/Win32CORE.c 2008-05-30 16:12:33.000000000 -0700
@@ -10,7 +10,13 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
+#if defined(__CYGWIN__) && !defined(USEIMPORTLIB)
+ #undef WIN32
+#endif
#include "EXTERN.h"
+#if defined(__CYGWIN__) && !defined(USEIMPORTLIB)
+ #define EXTCONST extern const
+#endif
#include "perl.h"
#include "XSUB.h"
@@ -62,7 +68,7 @@
* should never be called though, as Win32CORE.pm doesn't use DynaLoader.
*/
}
-#ifdef __CYGWIN__
+#if defined(__CYGWIN__) && defined(USEIMPORTLIB)
__declspec(dllexport)
#endif
void
==== //depot/maint-5.10/perl/lib/mro.pm#2 (text) ====
Index: perl/lib/mro.pm
--- perl/lib/mro.pm#1~32694~ 2007-12-22 01:23:09.000000000 -0800
+++ perl/lib/mro.pm 2008-05-30 16:12:33.000000000 -0700
@@ -310,7 +310,7 @@
In simple cases, it is equivalent to:
- $self->next::method(@_) if $self->next_can;
+ $self->next::method(@_) if $self->next::can;
But there are some cases where only this solution
works (like C<goto &maybe::next::method>);
==== //depot/maint-5.10/perl/mg.c#12 (text) ====
Index: perl/mg.c
--- perl/mg.c#11~33950~ 2008-05-30 08:37:39.000000000 -0700
+++ perl/mg.c 2008-05-30 16:12:33.000000000 -0700
@@ -508,6 +508,7 @@
SvMAGIC_set(sv, moremagic);
}
SvMAGIC_set(sv, NULL);
+ SvMAGICAL_off(sv);
return 0;
}
==== //depot/maint-5.10/perl/sv.c#18 (text) ====
Index: perl/sv.c
--- perl/sv.c#17~33946~ 2008-05-28 16:09:01.000000000 -0700
+++ perl/sv.c 2008-05-30 16:12:33.000000000 -0700
@@ -3413,7 +3413,6 @@
{
/* need to nuke the magic */
mg_free(dstr);
- SvRMAGICAL_off(dstr);
}
/* There's a lot of redundancy below but we're going for speed here */
==== //depot/maint-5.10/perl/t/op/range.t#3 (xtext) ====
Index: perl/t/op/range.t
--- perl/t/op/range.t#2~33856~ 2008-05-18 09:11:18.000000000 -0700
+++ perl/t/op/range.t 2008-05-30 16:12:33.000000000 -0700
@@ -9,7 +9,7 @@
use Config;
-plan (115);
+plan (135);
is(join(':',1..5), '1:2:3:4:5');
@@ -341,4 +341,66 @@
ok($@, 'Lower bound rejected: ' . -$ii);
}
+# double/tripple magic tests
+sub TIESCALAR { bless { value => $_[1], orig => $_[1] } }
+sub STORE { $_[0]{store}++; $_[0]{value} = $_[1] }
+sub FETCH { $_[0]{fetch}++; $_[0]{value} }
+sub stores { tied($_[0])->{value} = tied($_[0])->{orig};
+ delete(tied($_[0])->{store}) || 0 }
+sub fetches { delete(tied($_[0])->{fetch}) || 0 }
+
+tie $x, "main", 6;
+
+my @foo;
+@foo = 4 .. $x;
+is(scalar @foo, 3);
+is("@foo", "4 5 6");
+{
+ local $TODO = "test for double magic with range operator";
+ is(fetches($x), 1);
+}
+is(stores($x), 0);
+
+@foo = $x .. 8;
+is(scalar @foo, 3);
+is("@foo", "6 7 8");
+{
+ local $TODO = "test for double magic with range operator";
+ is(fetches($x), 1);
+}
+is(stores($x), 0);
+
+@foo = $x .. $x + 1;
+is(scalar @foo, 2);
+is("@foo", "6 7");
+{
+ local $TODO = "test for double magic with range operator";
+ is(fetches($x), 2);
+}
+is(stores($x), 0);
+
+@foo = ();
+for (4 .. $x) {
+ push @foo, $_;
+}
+is(scalar @foo, 3);
+is("@foo", "4 5 6");
+{
+ local $TODO = "test for double magic with range operator";
+ is(fetches($x), 1);
+}
+is(stores($x), 0);
+
+@foo = ();
+for (reverse 4 .. $x) {
+ push @foo, $_;
+}
+is(scalar @foo, 3);
+is("@foo", "6 5 4");
+{
+ local $TODO = "test for double magic with range operator";
+ is(fetches($x), 1);
+}
+is(stores($x), 0);
+
# EOF
==== //depot/maint-5.10/perl/t/run/switches.t#3 (text) ====
Index: perl/t/run/switches.t
--- perl/t/run/switches.t#2~33614~ 2008-03-31 09:59:07.000000000 -0700
+++ perl/t/run/switches.t 2008-05-30 16:12:33.000000000 -0700
@@ -11,7 +11,7 @@
BEGIN { require "./test.pl"; }
-plan(tests => 67);
+plan(tests => 68);
use Config;
@@ -346,3 +346,9 @@
switches => [ '-E', '"given(undef) {when(undef) { say q(Hello, world!)"}}']
);
is( $r, "Hello, world!\n", "-E given" );
+
+$r = runperl(
+ switches => [ '-nE', q('} END { say q/affe/') ],
+ stdin => 'zomtek',
+);
+is( $r, "affe\n", '-E works outside of the block created by -n' );
==== //depot/maint-5.10/perl/toke.c#7 (text) ====
Index: perl/toke.c
--- perl/toke.c#6~33941~ 2008-05-27 15:58:13.000000000 -0700
+++ perl/toke.c 2008-05-30 16:12:33.000000000 -0700
@@ -3619,6 +3619,9 @@
sv_free((SV*)PL_preambleav);
PL_preambleav = NULL;
}
+ if (PL_minus_E)
+ sv_catpvs(PL_linestr,
+ "use feature ':5." STRINGIFY(PERL_VERSION) "';");
if (PL_minus_n || PL_minus_p) {
sv_catpvs(PL_linestr, "LINE: while (<>) {");
if (PL_minus_l)
@@ -3650,9 +3653,6 @@
sv_catpvs(PL_linestr,"our @F=split(' ');");
}
}
- if (PL_minus_E)
- sv_catpvs(PL_linestr,
- "use feature ':5." STRINGIFY(PERL_VERSION) "';");
sv_catpvs(PL_linestr, "\n");
PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = SvPVX(PL_linestr);
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
End of Patch.
-
Change 33953: Integrate:
by Dave Mitchell