summaryrefslogtreecommitdiff
path: root/feature.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-12-22 22:12:23 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-12-24 09:25:18 -0800
commit4160ddbd34d65f63317a6e87331c497432389b1e (patch)
tree931a8758a9aa5a8ea0ff086680f160a4366de3f3 /feature.h
parent7d058bc9453370017e3a3e70a0897188891b03cb (diff)
downloadperl-4160ddbd34d65f63317a6e87331c497432389b1e.tar.gz
feature.h: Function for enabling bundles
Diffstat (limited to 'feature.h')
-rw-r--r--feature.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/feature.h b/feature.h
index 1cbd0478e5..ce8d81be80 100644
--- a/feature.h
+++ b/feature.h
@@ -89,4 +89,25 @@
#endif /* PERL_CORE or PERL_EXT */
+#ifdef PERL_IN_OP_C
+PERL_STATIC_INLINE void
+S_enable_feature_bundle(pTHX_ SV *ver)
+{
+ SV *comp_ver = sv_newmortal();
+ PL_hints = (PL_hints &~ HINT_FEATURE_MASK)
+ | (
+ (sv_setnv(comp_ver, 5.015),
+ vcmp(ver, upg_version(comp_ver, FALSE)) >= 0)
+ ? FEATURE_BUNDLE_515 :
+ (sv_setnv(comp_ver, 5.011),
+ vcmp(ver, upg_version(comp_ver, FALSE)) >= 0)
+ ? FEATURE_BUNDLE_511 :
+ (sv_setnv(comp_ver, 5.009005),
+ vcmp(ver, upg_version(comp_ver, FALSE)) >= 0)
+ ? FEATURE_BUNDLE_510 :
+ FEATURE_BUNDLE_DEFAULT
+ ) << HINT_FEATURE_SHIFT;
+}
+#endif /* PERL_IN_OP_C */
+
/* ex: set ro: */