summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
author卜部昌平 <[email protected]>2021-01-20 11:33:32 +0900
committer卜部昌平 <[email protected]>2021-01-27 09:30:15 +0900
commit3f4f10bb603a1c8979919c6b0ca1d8b2e7adba67 (patch)
tree045016cfe205f1033c841265f56d2bb36b9feb23 /include/ruby
parentc7d138772167a9a489ebe062ee3027e838489e8d (diff)
attributes on enumerators are GCC6-ism
See also https://gcc.gnu.org/gcc-6/changes.html Clang has this feature when __has_extension(enumerator_attributes) is set. MSVC has #pragma deprecated instead.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4100
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/internal/fl_type.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/ruby/internal/fl_type.h b/include/ruby/internal/fl_type.h
index 6641dfe4cb..29cc6baf6c 100644
--- a/include/ruby/internal/fl_type.h
+++ b/include/ruby/internal/fl_type.h
@@ -28,8 +28,10 @@
#include "ruby/internal/attr/noalias.h"
#include "ruby/internal/attr/pure.h"
#include "ruby/internal/cast.h"
+#include "ruby/internal/compiler_since.h"
#include "ruby/internal/core/rbasic.h"
#include "ruby/internal/dllexport.h"
+#include "ruby/internal/has/extension.h"
#include "ruby/internal/special_consts.h"
#include "ruby/internal/stdbool.h"
#include "ruby/internal/value.h"
@@ -167,11 +169,27 @@ ruby_fl_type {
RUBY_FL_PROMOTED = RUBY_FL_PROMOTED0 | RUBY_FL_PROMOTED1,
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)
RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
+#elif defined(_MSC_VER)
+# pragma deprecated(RUBY_FL_TAINT)
+#endif
+
= (1<<8),
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)
RBIMPL_ATTR_DEPRECATED(("trustedness turned out to be a wrong idea."))
+#elif defined(_MSC_VER)
+# pragma deprecated(RUBY_FL_UNTRUSTED)
+#endif
+
= (1<<8),
RUBY_FL_SEEN_OBJ_ID = (1<<9),
RUBY_FL_EXIVAR = (1<<10),