summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2008-05-30 23:12:33 +0000
committerDave Mitchell <davem@fdisolutions.com>2008-05-30 23:12:33 +0000
commitbf1f9377deaff3e3b48f3dcea8fe9e554d88703a (patch)
tree0f48c0c6aed40dd229214c51834e06de6b0076cb
parent9846cc773cc29998430a9325956182cba45d4559 (diff)
downloadperl-bf1f9377deaff3e3b48f3dcea8fe9e554d88703a.tar.gz
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> p4raw-link: @33822 on //depot/perl: 9f6397285900782ac168be55e879a6ac4fab7094 p4raw-link: @33815 on //depot/perl: 68f8932eb570af656553ed44c11a23f0a216a3ec p4raw-link: @33792 on //depot/perl: b1d302cbe753429dce7ea0bbcc432c1242204c19 p4raw-link: @33791 on //depot/perl: bd1c7bd234f2a9333e663f56f79a09143b3a74b5 p4raw-link: @33789 on //depot/perl: 76051f89dc2ad7585c06b6e815ceebf5a2c5e909 p4raw-id: //depot/maint-5.10/perl@33953 p4raw-integrated: from //depot/perl@33950 'copy in' ext/Win32CORE/Makefile.PL (@31229..) ext/Win32CORE/Win32CORE.c (@31490..) lib/mro.pm (@31836..) t/op/range.t (@32979..) 'edit in' t/run/switches.t (@33407..) p4raw-integrated: from //depot/perl@33822 'merge in' toke.c (@33437..) p4raw-integrated: from //depot/perl@33815 'merge in' mg.c (@33741..) sv.c (@33807..)
-rw-r--r--ext/Win32CORE/Makefile.PL12
-rw-r--r--ext/Win32CORE/Win32CORE.c8
-rw-r--r--lib/mro.pm2
-rw-r--r--mg.c1
-rw-r--r--sv.c1
-rwxr-xr-xt/op/range.t64
-rw-r--r--t/run/switches.t8
-rw-r--r--toke.c6
8 files changed, 94 insertions, 8 deletions
diff --git a/ext/Win32CORE/Makefile.PL b/ext/Win32CORE/Makefile.PL
index 0fec3061be..77c1f327af 100644
--- a/ext/Win32CORE/Makefile.PL
+++ b/ext/Win32CORE/Makefile.PL
@@ -4,3 +4,15 @@ WriteMakefile(
'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;
+}
diff --git a/ext/Win32CORE/Win32CORE.c b/ext/Win32CORE/Win32CORE.c
index 7769c7464d..9863b5b51a 100644
--- a/ext/Win32CORE/Win32CORE.c
+++ b/ext/Win32CORE/Win32CORE.c
@@ -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 @@ XS(boot_Win32CORE)
* should never be called though, as Win32CORE.pm doesn't use DynaLoader.
*/
}
-#ifdef __CYGWIN__
+#if defined(__CYGWIN__) && defined(USEIMPORTLIB)
__declspec(dllexport)
#endif
void
diff --git a/lib/mro.pm b/lib/mro.pm
index 858b8e5451..d4be79a873 100644
--- a/lib/mro.pm
+++ b/lib/mro.pm
@@ -310,7 +310,7 @@ exist.
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>);
diff --git a/mg.c b/mg.c
index 20d4dccf2b..aac0293e5c 100644
--- a/mg.c
+++ b/mg.c
@@ -508,6 +508,7 @@ Perl_mg_free(pTHX_ SV *sv)
SvMAGIC_set(sv, moremagic);
}
SvMAGIC_set(sv, NULL);
+ SvMAGICAL_off(sv);
return 0;
}
diff --git a/sv.c b/sv.c
index a2f9a01cb2..de8ac9b73d 100644
--- a/sv.c
+++ b/sv.c
@@ -3413,7 +3413,6 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
{
/* 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 */
diff --git a/t/op/range.t b/t/op/range.t
index 6759f88366..214c16835f 100755
--- a/t/op/range.t
+++ b/t/op/range.t
@@ -9,7 +9,7 @@ require 'test.pl';
use Config;
-plan (115);
+plan (135);
is(join(':',1..5), '1:2:3:4:5');
@@ -341,4 +341,66 @@ foreach my $ii (~0, ~0+1, ~0+(~0>>4)) {
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
diff --git a/t/run/switches.t b/t/run/switches.t
index 46fe553da8..4f65a803e0 100644
--- a/t/run/switches.t
+++ b/t/run/switches.t
@@ -11,7 +11,7 @@ BEGIN {
BEGIN { require "./test.pl"; }
-plan(tests => 67);
+plan(tests => 68);
use Config;
@@ -346,3 +346,9 @@ $r = runperl(
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' );
diff --git a/toke.c b/toke.c
index 1c2c022d40..fbdb0115ec 100644
--- a/toke.c
+++ b/toke.c
@@ -3619,6 +3619,9 @@ Perl_yylex(pTHX)
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 @@ Perl_yylex(pTHX)
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);