Make MAX_FEATURE_LEN reflect reality
authorFather Chrysostomos <sprout@cpan.org>
Fri, 23 Dec 2011 06:51:50 +0000 (22:51 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 24 Dec 2011 17:25:20 +0000 (09:25 -0800)
unicode_strings was not the longest string.  We can determine it auto-
matically, now that this macro is in a generated file.

feature.h
regen/feature.pl

index e34c3d3..b32ff93 100644 (file)
--- a/feature.h
+++ b/feature.h
@@ -24,7 +24,7 @@
           & 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 \
     ( \
index 44861a2..20cfd4f 100755 (executable)
@@ -220,10 +220,14 @@ print $h <<'EOH';
           & 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
 
+my $longest_internal_feature_name = longest values %feature;
+print $h <<EOL;
+#define MAX_FEATURE_LEN (sizeof("$longest_internal_feature_name")-1)
+
+EOL
+
 for (
     sort { length $a <=> length $b } keys %feature
 ) {