ruby-changes:41715
From: nobu <ko1@a...>
Date: Tue, 9 Feb 2016 16:36:18 +0900 (JST)
Subject: [ruby-changes:41715] nobu:r53789 (trunk): ruby.c: EACH_DEBUG_FEATURES
nobu 2016-02-09 16:36:27 +0900 (Tue, 09 Feb 2016) New Revision: 53789 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53789 Log: ruby.c: EACH_DEBUG_FEATURES * ruby.c (EACH_DEBUG_FEATURES): define the list of debug feature names. Modified files: trunk/ruby.c Index: ruby.c =================================================================== --- ruby.c (revision 53788) +++ ruby.c (revision 53789) @@ -70,11 +70,15 @@ char *getenv(); https://github.com/ruby/ruby/blob/trunk/ruby.c#L70 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, https://github.com/ruby/ruby/blob/trunk/ruby.c#L811 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); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/