From dae5e2fabea4c8c359752df07b30a864848cf93f Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 10 Jul 2011 03:06:11 -0500 Subject: use Devel::CallChecker to get things working on 5.12 5.10 still has issues --- core.xs | 2 ++ dist.ini | 4 ++++ inc/MakeMaker.pm | 18 +++++++++++------- lib/smartmatch/engine/core.pm | 4 +++- t/core.t | 5 ----- t/error.t | 5 ----- 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/core.xs b/core.xs index 3f12ea2..8650266 100644 --- a/core.xs +++ b/core.xs @@ -6,6 +6,8 @@ #include "stolen_chunk_of_pp_ctl.c" +#include "callchecker0.h" + STATIC OP* install_sm_op(pTHX_ OP *o, GV *gv, SV *ud) { diff --git a/dist.ini b/dist.ini index f49e982..bcd7a56 100644 --- a/dist.ini +++ b/dist.ini @@ -14,4 +14,8 @@ dist = smartmatch-engine-core [=inc::MakeMaker] [Prereqs] +Devel::CallChecker = 0 smartmatch = 0.02 + +[Prereqs / ConfigureRequires] +Devel::CallChecker = 0 diff --git a/inc/MakeMaker.pm b/inc/MakeMaker.pm index b41113a..5c918b4 100644 --- a/inc/MakeMaker.pm +++ b/inc/MakeMaker.pm @@ -9,16 +9,20 @@ override _build_MakeFile_PL_template => sub { my $tmpl = super; my $depends = <<'END'; -if ($] < 5.014) { - %WriteMakefileArgs = ( - %WriteMakefileArgs, - XS => {}, - C => [], - ); -} +%WriteMakefileArgs = ( + %WriteMakefileArgs, + Devel::CallChecker::callchecker_linkable, +); 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; +END return $tmpl; }; diff --git a/lib/smartmatch/engine/core.pm b/lib/smartmatch/engine/core.pm index df9af82..69fab65 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 && $] >= 5.014) { +if (!$smartmatch::engine::core::USE_PP) { __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 @@ -20,6 +20,8 @@ if (!$smartmatch::engine::core::USE_PP && $] >= 5.014) { init(__PACKAGE__->can('match')); } +use Devel::CallChecker; + use B; use Carp qw(croak); use Hash::Util::FieldHash qw(idhash); diff --git a/t/core.t b/t/core.t index 0d7f7ec..69c0942 100644 --- a/t/core.t +++ b/t/core.t @@ -3,11 +3,6 @@ use strict; use warnings; use Test::More; -BEGIN { - plan skip_all => "no c implementation for pre-5.14 for now" - if $] < 5.014; -} - use smartmatch 'core'; no warnings 'uninitialized'; diff --git a/t/error.t b/t/error.t index 4f86a87..edba950 100644 --- a/t/error.t +++ b/t/error.t @@ -3,11 +3,6 @@ use strict; use warnings; use Test::More; -BEGIN { - plan skip_all => "no c implementation for pre-5.14 for now" - if $] < 5.014; -} - my $foo = bless {}; my $bar = bless {}; -- cgit v1.2.3-54-g00ecf