From 89c6bc139ff134699ff97779d3d2e4f044cfdb97 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sun, 7 Nov 2010 10:20:36 +0000 Subject: [PATCH] In B.xs, move the version dependant regexp code to be adjacent. --- ext/B/B.xs | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/ext/B/B.xs b/ext/B/B.xs index fb450ef..3e10f3c 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -1578,6 +1578,27 @@ B::SV SvRV(sv) B::RV sv +#else + +MODULE = B PACKAGE = B::REGEXP + +IV +REGEX(sv) + B::REGEXP sv + CODE: + /* FIXME - can we code this method more efficiently? */ + RETVAL = PTR2IV(sv); + OUTPUT: + RETVAL + +SV* +precomp(sv) + B::REGEXP sv + CODE: + RETVAL = newSVpvn( RX_PRECOMP(sv), RX_PRELEN(sv) ); + OUTPUT: + RETVAL + #endif MODULE = B PACKAGE = B::PV PREFIX = Sv @@ -1645,29 +1666,6 @@ SvMAGIC(sv) for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) XPUSHs(make_mg_object(aTHX_ mg)); -MODULE = B PACKAGE = B::REGEXP - -#if PERL_VERSION >= 11 - -IV -REGEX(sv) - B::REGEXP sv - CODE: - /* FIXME - can we code this method more efficiently? */ - RETVAL = PTR2IV(sv); - OUTPUT: - RETVAL - -SV* -precomp(sv) - B::REGEXP sv - CODE: - RETVAL = newSVpvn( RX_PRECOMP(sv), RX_PRELEN(sv) ); - OUTPUT: - RETVAL - -#endif - MODULE = B PACKAGE = B::MAGIC void -- 2.7.4