1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2016-02-09 07:36:27 +00:00
parent 07983edfe3
commit ade0d8e26e

10
ruby.c
View file

@ -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);
}