summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-07 10:21:27 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-07 10:21:27 +0000
commit2c9274eff2e2c0451145116f68ac3be371ebd66e (patch)
tree07b471107f1f39b314fec4286fd428744a500ddd /ruby.c
parente40d1173397becd705ee55fddde51432ec4638a2 (diff)
ruby.c: EACH_FEATURES
* ruby.c (EACH_FEATURES): define the list of feature names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/ruby.c b/ruby.c
index 9637ea4..25a55a5 100644
--- a/ruby.c
+++ b/ruby.c
@@ -64,11 +64,15 @@ char *getenv();
#endif
#define FEATURE_BIT(bit) (1U << feature_##bit)
+#define EACH_FEATURES(X) \
+ X(gems) \
+ X(did_you_mean) \
+ X(rubyopt) \
+ X(frozen_string_literal) \
+ /* END OF FEATURES */
+#define DEFINE_FEATURE(bit) feature_##bit,
enum feature_flag_bits {
- feature_gems,
- feature_did_you_mean,
- feature_rubyopt,
- feature_frozen_string_literal,
+ EACH_FEATURES(DEFINE_FEATURE)
feature_debug_frozen_string_literal,
feature_flag_count
};
@@ -754,10 +758,7 @@ feature_option(const char *str, int len, void *arg, const unsigned int enable)
unsigned int mask = ~0U;
#define SET_FEATURE(bit) \
if (NAME_MATCH_P(#bit, str, len)) {mask = FEATURE_BIT(bit); goto found;}
- SET_FEATURE(gems);
- SET_FEATURE(did_you_mean);
- SET_FEATURE(rubyopt);
- SET_FEATURE(frozen_string_literal);
+ EACH_FEATURES(SET_FEATURE);
if (NAME_MATCH_P("all", str, len)) {
found:
*argp = (*argp & ~mask) | (mask & enable);