summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-09 07:36:27 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-09 07:36:27 (GMT)
commitade0d8e26e409b3250184fcdc043049a26aba4da (patch)
tree3c0e5fff688db4bb954049dc8fc6f58ee9538c34 /ruby.c
parent07983edfe34529903a1d76e9d9c4ca6c65411043 (diff)
ruby.c: EACH_DEBUG_FEATURES
* ruby.c (EACH_DEBUG_FEATURES): define the list of debug feature names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ruby.c b/ruby.c
index 23e44cf..a9bb60b 100644
--- a/ruby.c
+++ b/ruby.c
@@ -70,11 +70,15 @@ char *getenv();
X(rubyopt) \
X(frozen_string_literal) \
/* END OF FEATURES */
+#define EACH_DEBUG_FEATURES(X) \
+ X(frozen_string_literal) \
+ /* END OF DEBUG FEATURES */
#define AMBIGUOUS_FEATURE_NAMES 0 /* no ambiguous feature names now */
#define DEFINE_FEATURE(bit) feature_##bit,
+#define DEFINE_DEBUG_FEATURE(bit) feature_debug_##bit,
enum feature_flag_bits {
EACH_FEATURES(DEFINE_FEATURE)
- feature_debug_frozen_string_literal,
+ EACH_DEBUG_FEATURES(DEFINE_DEBUG_FEATURE)
feature_flag_count
};
@@ -807,8 +811,8 @@ disable_option(const char *str, int len, void *arg)
static void
debug_option(const char *str, int len, void *arg)
{
-#define SET_WHEN_DEBUG(t, bit) SET_WHEN(#bit, t##_BIT(bit), str, len)
- SET_WHEN_DEBUG(DEBUG, frozen_string_literal);
+#define SET_WHEN_DEBUG(bit) SET_WHEN(#bit, DEBUG_BIT(bit), str, len)
+ EACH_DEBUG_FEATURES(SET_WHEN_DEBUG);
rb_warn("unknown argument for --debug: `%.*s'", len, str);
}