From d1fd0100b99385b1e0c84be811cacef81d01c17a Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Thu, 22 Dec 2011 10:20:01 -0800 Subject: 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. --- feature.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'feature.h') 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: */ -- cgit v1.2.1