diff --git a/Clone.xs b/Clone.xs index dccdce5..5eeac07 100644 --- a/Clone.xs +++ b/Clone.xs @@ -174,7 +174,7 @@ sv_clone (SV * ref, HV* hseen, int depth) * Note: when using a Debug Perl with READONLY_COW * we cannot do 'sv_buf_to_rw + sv_buf_to_ro' as these APIs calls are not exported */ -#if PERL_VERSION >= 20 && !defined(PERL_DEBUG_READONLY_COW) +#if defined(SV_COW_REFCNT_MAX) && !defined(PERL_DEBUG_READONLY_COW) /* only for simple PVs unblessed */ if ( SvIsCOW(ref) && !SvOOK(ref) && SvLEN(ref) > 0 ) { diff --git a/t/03scalar.t b/t/03scalar.t index bbed4d1..a5cbeaf 100755 --- a/t/03scalar.t +++ b/t/03scalar.t @@ -8,13 +8,14 @@ # (It may become useful if the test is moved to ./t subdirectory.) use B q{svref_2object}; +use B::COW; my $has_data_dumper; BEGIN { $| = 1; my $tests = 12; - $tests += 2 if $] > 5.0219; + $tests += 2 if B::COW::can_cow(); eval q[use Data::Dumper]; if (!$@) { $has_data_dumper = 1; @@ -100,7 +101,7 @@ ok( $a != $b, '$a != $b' ); ok( $c != $d, 'SV are differents SVs' ); - if ( $] > 5.0219 ) { + if ( B::COW::can_cow() ) { my $sv_c = svref_2object( $c ); my $sv_d = svref_2object( $d );