This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In installperl, convert the File::Find::find(..., 'lib/') to no_chdir.
[perl5.git] / feature.h
index ce8d81b..2d06450 100644 (file)
--- a/feature.h
+++ b/feature.h
 #define CURRENT_FEATURE_BUNDLE (CURRENT_HINTS >> HINT_FEATURE_SHIFT)
 
 #define FEATURE_IS_ENABLED(name)                                       \
-       (((PL_curcop == &PL_compiling ? PL_hints : PL_curcop->cop_hints) \
+       ((CURRENT_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 MAX_FEATURE_LEN (sizeof("evalbytes")-1)
 
 #define FEATURE_SAY_IS_ENABLED \
     ( \
@@ -107,6 +107,10 @@ S_enable_feature_bundle(pTHX_ SV *ver)
                        ? FEATURE_BUNDLE_510 :
                          FEATURE_BUNDLE_DEFAULT
               ) << HINT_FEATURE_SHIFT;
+    /* special case */
+    assert(PL_curcop == &PL_compiling);
+    if (FEATURE_UNICODE_IS_ENABLED) PL_hints |=  HINT_UNI_8_BIT;
+    else                           PL_hints &= ~HINT_UNI_8_BIT;
 }
 #endif /* PERL_IN_OP_C */