From: Father Chrysostomos Date: Thu, 22 Dec 2011 18:20:01 +0000 (-0800) Subject: feature.h: Add macros for current hints X-Git-Tag: accepted/trunk/20130322.191538~1553^2~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1fd0100b99385b1e0c84be811cacef81d01c17a;p=platform%2Fupstream%2Fperl.git feature.h: Add macros for current hints CURRENT_HINTS is not specific to features, but for now will be used by nothing else. It returns the compile-time or run-time hints, depend- ing on whether PL_curcop points to &PL_compiling. CURRENT_FEATURE_BUNDLE extracts the feature bundle number from the current hints. --- diff --git a/feature.h b/feature.h index 0b5f85c..3ce6e85 100644 --- a/feature.h +++ b/feature.h @@ -15,6 +15,10 @@ #define FEATURE_BUNDLE_515 3 #define FEATURE_BUNDLE_CUSTOM (HINT_FEATURE_MASK >> HINT_FEATURE_SHIFT) +#define CURRENT_HINTS \ + (PL_curcop == &PL_compiling ? PL_hints : PL_curcop->cop_hints) +#define CURRENT_FEATURE_BUNDLE (CURRENT_HINTS >> HINT_FEATURE_SHIFT) + #endif /* PERL_CORE or PERL_EXT */ /* ex: set ro: */ diff --git a/regen/feature.pl b/regen/feature.pl index e63bd50..6cbcd62 100755 --- a/regen/feature.pl +++ b/regen/feature.pl @@ -163,6 +163,10 @@ for (sort values %UniqueBundles) { print $h <> HINT_FEATURE_SHIFT) +#define CURRENT_HINTS \\ + (PL_curcop == &PL_compiling ? PL_hints : PL_curcop->cop_hints) +#define CURRENT_FEATURE_BUNDLE (CURRENT_HINTS >> HINT_FEATURE_SHIFT) + #endif /* PERL_CORE or PERL_EXT */ EOH