Skip to content

Commit

Permalink
Add require_false feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
David Farrell committed Jul 1, 2018
1 parent 1e98119 commit 66f4394
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 7 additions & 1 deletion feature.h
Expand Up @@ -29,7 +29,7 @@
& HINT_LOCALIZE_HH) \
? Perl_feature_is_enabled(aTHX_ STR_WITH_LEN(name)) : FALSE)
/* The longest string we pass in. */
#define MAX_FEATURE_LEN (sizeof("postderef_qq")-1)
#define MAX_FEATURE_LEN (sizeof("require_false")-1)

#define FEATURE_FC_IS_ENABLED \
( \
Expand Down Expand Up @@ -127,6 +127,12 @@
FEATURE_IS_ENABLED("myref") \
)

#define FEATURE_REQUIRE_FALSE_IS_ENABLED \
( \
CURRENT_FEATURE_BUNDLE == FEATURE_BUNDLE_CUSTOM && \
FEATURE_IS_ENABLED("require_false") \
)

#define FEATURE_UNICODE_IS_ENABLED \
( \
(CURRENT_FEATURE_BUNDLE >= FEATURE_BUNDLE_511 && \
Expand Down
3 changes: 2 additions & 1 deletion lib/feature.pm
Expand Up @@ -21,6 +21,7 @@ our %feature = (
postderef_qq => 'feature_postderef_qq',
unicode_eval => 'feature_unieval',
declared_refs => 'feature_myref',
require_false => 'feature_require_false',
unicode_strings => 'feature_unicode',
);

Expand All @@ -30,7 +31,7 @@ our %feature_bundle = (
"5.15" => [qw(current_sub evalbytes fc say state switch unicode_eval unicode_strings)],
"5.23" => [qw(current_sub evalbytes fc postderef_qq say state switch unicode_eval unicode_strings)],
"5.27" => [qw(bitwise current_sub evalbytes fc postderef_qq say state switch unicode_eval unicode_strings)],
"all" => [qw(array_base bitwise current_sub declared_refs evalbytes fc postderef_qq refaliasing say signatures state switch unicode_eval unicode_strings)],
"all" => [qw(array_base bitwise current_sub declared_refs evalbytes fc postderef_qq refaliasing require_false say signatures state switch unicode_eval unicode_strings)],
"default" => [qw(array_base)],
);

Expand Down
1 change: 1 addition & 0 deletions regen/feature.pl
Expand Up @@ -36,6 +36,7 @@ BEGIN
unicode_strings => 'unicode',
fc => 'fc',
signatures => 'signatures',
require_false => 'require_false',
);

# NOTE: If a feature is ever enabled in a non-contiguous range of Perl
Expand Down

0 comments on commit 66f4394

Please sign in to comment.