diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-12-22 21:42:54 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-12-24 09:25:18 -0800 |
commit | 7d058bc9453370017e3a3e70a0897188891b03cb (patch) | |
tree | f782272281505c1da89ed22e8971321c5d3f2837 | |
parent | dd0ac2b9f1fe5cbdd4fd355527bd5e60b37a4d14 (diff) | |
download | perl-7d058bc9453370017e3a3e70a0897188891b03cb.tar.gz |
Move FEATURE_IS_ENABLED to feature.h
It makes little sense to have it in perl.h any more. (Until
recently, feature.h didn’t exist.)
-rw-r--r-- | feature.h | 7 | ||||
-rw-r--r-- | perl.h | 9 | ||||
-rwxr-xr-x | regen/feature.pl | 11 |
3 files changed, 16 insertions, 11 deletions
@@ -19,6 +19,13 @@ (PL_curcop == &PL_compiling ? PL_hints : PL_curcop->cop_hints) #define CURRENT_FEATURE_BUNDLE (CURRENT_HINTS >> HINT_FEATURE_SHIFT) +#define FEATURE_IS_ENABLED(name) \ + (((PL_curcop == &PL_compiling ? PL_hints : PL_curcop->cop_hints) \ + & HINT_LOCALIZE_HH) \ + && Perl_feature_is_enabled(aTHX_ STR_WITH_LEN(name))) +/* The longest string we pass in. */ +#define MAX_FEATURE_LEN (sizeof("unicode_strings")-1) + #define FEATURE_SAY_IS_ENABLED \ ( \ (CURRENT_FEATURE_BUNDLE >= FEATURE_BUNDLE_510 && \ @@ -5747,15 +5747,6 @@ extern void moncontrol(int); #define PERL_PV_PRETTY_DUMP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE #define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE|PERL_PV_ESCAPE_NONASCII -#if defined(PERL_CORE) || defined(PERL_EXT) -# define FEATURE_IS_ENABLED(name) \ - (((PL_curcop == &PL_compiling ? PL_hints : PL_curcop->cop_hints) \ - & HINT_LOCALIZE_HH) \ - && Perl_feature_is_enabled(aTHX_ STR_WITH_LEN(name))) -/* The longest string we pass in. */ -# define MAX_FEATURE_LEN (sizeof("unicode_strings")-1) -#endif - /* (KEEP THIS LAST IN perl.h!) diff --git a/regen/feature.pl b/regen/feature.pl index ab60389edd..32d7123187 100755 --- a/regen/feature.pl +++ b/regen/feature.pl @@ -209,13 +209,20 @@ for (@HintedBundles) { print $h "#define FEATURE_BUNDLE_$key ", $count++, "\n"; } -print $h <<EOH; +print $h <<'EOH'; #define FEATURE_BUNDLE_CUSTOM (HINT_FEATURE_MASK >> HINT_FEATURE_SHIFT) -#define CURRENT_HINTS \\ +#define CURRENT_HINTS \ (PL_curcop == &PL_compiling ? PL_hints : PL_curcop->cop_hints) #define CURRENT_FEATURE_BUNDLE (CURRENT_HINTS >> HINT_FEATURE_SHIFT) +#define FEATURE_IS_ENABLED(name) \ + (((PL_curcop == &PL_compiling ? PL_hints : PL_curcop->cop_hints) \ + & HINT_LOCALIZE_HH) \ + && Perl_feature_is_enabled(aTHX_ STR_WITH_LEN(name))) +/* The longest string we pass in. */ +#define MAX_FEATURE_LEN (sizeof("unicode_strings")-1) + EOH for ( |