[前][次][番号順一覧][スレッド一覧]

ruby-changes:41692

From: nobu <ko1@a...>
Date: Sun, 7 Feb 2016 19:21:22 +0900 (JST)
Subject: [ruby-changes:41692] nobu:r53766 (trunk): ruby.c: EACH_FEATURES

nobu	2016-02-07 19:21:27 +0900 (Sun, 07 Feb 2016)

  New Revision: 53766

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=53766

  Log:
    ruby.c: EACH_FEATURES
    
    * ruby.c (EACH_FEATURES): define the list of feature names.

  Modified files:
    trunk/ruby.c
Index: ruby.c
===================================================================
--- ruby.c	(revision 53765)
+++ ruby.c	(revision 53766)
@@ -64,11 +64,15 @@ char *getenv(); https://github.com/ruby/ruby/blob/trunk/ruby.c#L64
 #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, https://github.com/ruby/ruby/blob/trunk/ruby.c#L758
     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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]