From 1e0dc09f4e713228ffdf46562c54edca29c94a9f Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Thu, 22 Dec 2011 18:22:41 -0800 Subject: feature.pm: Set bundle hints when dis/enabling features The core does not use these hints just yet, but feature.pm can start setting them. Currently, the hint bits for feature bundles (CURRENT_FEATURE_BUNDLE in feature.h) are equal to FEATURE_BUNDLE_DEFAULT (0) by default. feature.pm sets them to FEATURE_BUNDLE_CUSTOM when modifying hint settings. --- regen/feature.pl | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'regen') diff --git a/regen/feature.pl b/regen/feature.pl index 2e8e8eb9a4..cf3ba35d53 100755 --- a/regen/feature.pl +++ b/regen/feature.pl @@ -535,6 +535,11 @@ sub import { if (@_ == 0) { croak("No features specified"); } + if (my $features = current_bundle) { + # Features are enabled implicitly via bundle hints + unshift @_, @$features; + $^H |= $hint_mask; + } while (@_) { my $name = shift(@_); if (substr($name, 0, 1) eq ":") { @@ -562,6 +567,13 @@ sub import { sub unimport { my $class = shift; + if (my $features = current_bundle) { + # Features are enabled implicitly via bundle hints + # Pass them to import() to put them in a form we can handle. + import(undef, @$features); + $^H |= $hint_mask; + } + # A bare C should disable *all* features if (!@_) { delete @^H{ values(%feature) }; -- cgit v1.2.1