Move FEATURE_IS_ENABLED to feature.h
authorFather Chrysostomos <sprout@cpan.org>
Fri, 23 Dec 2011 05:42:54 +0000 (21:42 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 24 Dec 2011 17:25:18 +0000 (09:25 -0800)
It makes little sense to have it in perl.h any more.  (Until
recently, feature.h didn’t exist.)

feature.h
perl.h
regen/feature.pl

index 31547fb..1cbd047 100644 (file)
--- a/feature.h
+++ b/feature.h
     (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 && \
diff --git a/perl.h b/perl.h
index 4dcd259..184d4b5 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -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!)
index ab60389..32d7123 100755 (executable)
@@ -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 (