summaryrefslogtreecommitdiff
path: root/feature.h
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 /feature.h
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 'feature.h')
-rw-r--r--feature.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/feature.h b/feature.h
index 0b5f85c2bc..3ce6e85f09 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: */