summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-07-10 03:45:28 -0500
committerJesse Luehrs <doy@tozt.net>2011-07-10 03:45:28 -0500
commit914cc469d74488bb6ddcaffe8316c8d3ac9479db (patch)
tree1c1623c7a7ff553f263c0b9f4e64ebfc912ac1c7
parentdae5e2fabea4c8c359752df07b30a864848cf93f (diff)
downloadsmartmatch-engine-core-914cc469d74488bb6ddcaffe8316c8d3ac9479db.tar.gz
smartmatch-engine-core-914cc469d74488bb6ddcaffe8316c8d3ac9479db.zip
nope, the opcode replacement won't work on 5.10
-rw-r--r--inc/MakeMaker.pm14
-rw-r--r--lib/smartmatch/engine/core.pm2
-rw-r--r--t/core.t4
-rw-r--r--t/error.t4
4 files changed, 18 insertions, 6 deletions
diff --git a/inc/MakeMaker.pm b/inc/MakeMaker.pm
index 5c918b4..375da9e 100644
--- a/inc/MakeMaker.pm
+++ b/inc/MakeMaker.pm
@@ -11,17 +11,21 @@ override _build_MakeFile_PL_template => sub {
my $depends = <<'END';
%WriteMakefileArgs = (
%WriteMakefileArgs,
- Devel::CallChecker::callchecker_linkable,
+ ($] >= 5.011002
+ ? (Devel::CallChecker::callchecker_linkable)
+ : (C => [], XS => {})),
);
END
$tmpl =~ s/(use ExtUtils.*)/$1\nuse Devel::CallChecker;/;
$tmpl =~ s/(WriteMakefile\()/$depends\n$1/;
$tmpl .= <<'END';
-open my $header, '>', 'callchecker0.h'
- or die "Couldn't open callchecker0.h for writing: $!";
-print $header Devel::CallChecker::callchecker0_h;
-close $header;
+if ($] >= 5.011002) {
+ open my $header, '>', 'callchecker0.h'
+ or die "Couldn't open callchecker0.h for writing: $!";
+ print $header Devel::CallChecker::callchecker0_h;
+ close $header;
+}
END
return $tmpl;
diff --git a/lib/smartmatch/engine/core.pm b/lib/smartmatch/engine/core.pm
index 69fab65..3a43f6a 100644
--- a/lib/smartmatch/engine/core.pm
+++ b/lib/smartmatch/engine/core.pm
@@ -8,7 +8,7 @@ use parent 'DynaLoader';
sub dl_load_flags { 0x01 }
-if (!$smartmatch::engine::core::USE_PP) {
+if (!$smartmatch::engine::core::USE_PP && $] >= 5.011002) {
__PACKAGE__->bootstrap(
# we need to be careful not to touch $VERSION at compile time,
# otherwise DynaLoader will assume it's set and check against it, which
diff --git a/t/core.t b/t/core.t
index 69c0942..9c646d4 100644
--- a/t/core.t
+++ b/t/core.t
@@ -3,6 +3,10 @@ use strict;
use warnings;
use Test::More;
+BEGIN {
+ plan skip_all => "xs version requires 5.11.2" unless $] >= 5.011002;
+}
+
use smartmatch 'core';
no warnings 'uninitialized';
diff --git a/t/error.t b/t/error.t
index edba950..1c8ea3f 100644
--- a/t/error.t
+++ b/t/error.t
@@ -3,6 +3,10 @@ use strict;
use warnings;
use Test::More;
+BEGIN {
+ plan skip_all => "xs version requires 5.11.2" unless $] >= 5.011002;
+}
+
my $foo = bless {};
my $bar = bless {};