summaryrefslogtreecommitdiff
path: root/regen/feature.pl
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-12-22 10:20:01 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-12-24 09:25:14 -0800
commitd1fd0100b99385b1e0c84be811cacef81d01c17a (patch)
tree336307f05a9ace8090b1d73b823a8ae81ed1deec /regen/feature.pl
parent2b9e0ab72974ddabc33d92aa62d36f45b365fcf4 (diff)
downloadperl-d1fd0100b99385b1e0c84be811cacef81d01c17a.tar.gz
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.
Diffstat (limited to 'regen/feature.pl')
-rwxr-xr-xregen/feature.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/regen/feature.pl b/regen/feature.pl
index e63bd50d3f..6cbcd62522 100755
--- a/regen/feature.pl
+++ b/regen/feature.pl
@@ -163,6 +163,10 @@ for (sort values %UniqueBundles) {
print $h <<EOH;
#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 */
EOH