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

ruby-changes:65059

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Wed, 27 Jan 2021 09:30:39 +0900 (JST)
Subject: [ruby-changes:65059] d205370b96 (master): include/ruby/internal/fl_type.h: refactor hoist out #if conditions

https://git.ruby-lang.org/ruby.git/commit/?id=d205370b96

From d205370b965a374a6c7ec3987e2b97f4b48621da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Tue, 26 Jan 2021 15:38:15 +0900
Subject: include/ruby/internal/fl_type.h: refactor hoist out #if conditions

cf: https://github.com/ruby/ruby/pull/4100#pullrequestreview-575952836
---
 include/ruby/internal/fl_type.h | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/include/ruby/internal/fl_type.h b/include/ruby/internal/fl_type.h
index 4bfae26..78d049a 100644
--- a/include/ruby/internal/fl_type.h
+++ b/include/ruby/internal/fl_type.h
@@ -40,6 +40,12 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/fl_type.h#L40
 #include "ruby/defines.h"
 
 /** @cond INTERNAL_MACRO */
+#if RBIMPL_HAS_EXTENSION(enumerator_attributes)
+# define RBIMPL_HAVE_ENUM_ATTRIBUTE 1
+#elif RBIMPL_COMPILER_SINCE(GCC, 6, 0, 0)
+# define RBIMPL_HAVE_ENUM_ATTRIBUTE 1
+#endif
+
 #ifdef ENUM_OVER_INT
 # define RBIMPL_WIDER_ENUM 1
 #elif SIZEOF_INT * CHAR_BIT > 12+19+1
@@ -170,9 +176,7 @@ ruby_fl_type { https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/fl_type.h#L176
     RUBY_FL_FINALIZE     = (1<<7),
     RUBY_FL_TAINT
 
-#if RBIMPL_HAS_EXTENSION(enumerator_attributes)
-    RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
-#elif RBIMPL_COMPILER_SINCE(GCC, 6, 0, 0)
+#if defined(RBIMPL_HAVE_ENUM_ATTRIBUTE)
     RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
 #elif defined(_MSC_VER)
 # pragma deprecated(RUBY_FL_TAINT)
@@ -182,9 +186,7 @@ ruby_fl_type { https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/fl_type.h#L186
     RUBY_FL_SHAREABLE    = (1<<8),
     RUBY_FL_UNTRUSTED
 
-#if RBIMPL_HAS_EXTENSION(enumerator_attributes)
-    RBIMPL_ATTR_DEPRECATED(("trustedness turned out to be a wrong idea."))
-#elif RBIMPL_COMPILER_SINCE(GCC, 6, 0, 0)
+#if defined(RBIMPL_HAVE_ENUM_ATTRIBUTE)
     RBIMPL_ATTR_DEPRECATED(("trustedness turned out to be a wrong idea."))
 #elif defined(_MSC_VER)
 # pragma deprecated(RUBY_FL_UNTRUSTED)
@@ -230,9 +232,7 @@ ruby_fl_type { https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/fl_type.h#L232
 enum {
     RUBY_FL_DUPPED
 
-#if RBIMPL_HAS_EXTENSION(enumerator_attributes)
-    RBIMPL_ATTR_DEPRECATED(("It seems there is no actual usage of this enum."))
-#elif RBIMPL_COMPILER_SINCE(GCC, 6, 0, 0)
+#if defined(RBIMPL_HAVE_ENUM_ATTRIBUTE)
     RBIMPL_ATTR_DEPRECATED(("It seems there is no actual usage of this enum."))
 #elif defined(_MSC_VER)
 # pragma deprecated(RUBY_FL_UNTRUSTED)
@@ -241,6 +241,8 @@ enum { https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/fl_type.h#L241
     = RUBY_T_MASK | RUBY_FL_EXIVAR
 };
 
+#undef RBIMPL_HAVE_ENUM_ATTRIBUTE
+
 RBIMPL_SYMBOL_EXPORT_BEGIN()
 void rb_obj_infect(VALUE victim, VALUE carrier);
 void rb_freeze_singleton_class(VALUE klass);
-- 
cgit v1.1


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

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