summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-22 01:00:43 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-22 02:51:49 +0900
commit8918a9cf6c65409ae1ffcdea324a1b97c6e5bb70 (patch)
tree21d993f31deddd50f3bc717be2ddce433db0d9f0 /spec
parentc30f03d32833f38fedf41ecb08f1ade9c6657fef (diff)
Removed rb_cData entity
* Use the wrapper of rb_cObject instead of data access * Replaced rest of extentions * Updated the version guard for Data * Added the version guard of rb_cData
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3961
Diffstat (limited to 'spec')
-rw-r--r--spec/ruby/core/data/constants_spec.rb2
-rw-r--r--spec/ruby/optional/capi/ext/constants_spec.c4
-rw-r--r--spec/ruby/optional/capi/ext/rubyspec.h4
3 files changed, 9 insertions, 1 deletions
diff --git a/spec/ruby/core/data/constants_spec.rb b/spec/ruby/core/data/constants_spec.rb
index 5027ae0d7e..a037bf6816 100644
--- a/spec/ruby/core/data/constants_spec.rb
+++ b/spec/ruby/core/data/constants_spec.rb
@@ -1,6 +1,6 @@
require_relative '../../spec_helper'
-ruby_version_is ''...'2.8' do
+ruby_version_is ''...'3.0' do
describe "Data" do
it "is a subclass of Object" do
suppress_warning do
diff --git a/spec/ruby/optional/capi/ext/constants_spec.c b/spec/ruby/optional/capi/ext/constants_spec.c
index 598d30a0be..27899ca4d9 100644
--- a/spec/ruby/optional/capi/ext/constants_spec.c
+++ b/spec/ruby/optional/capi/ext/constants_spec.c
@@ -14,7 +14,9 @@ defconstfunc(rb_cBinding)
defconstfunc(rb_cClass)
defconstfunc(rb_cComplex)
defconstfunc(rb_mComparable)
+#ifndef RUBY_VERSION_IS_3_0
defconstfunc(rb_cData)
+#endif
defconstfunc(rb_cDir)
defconstfunc(rb_cEncoding)
defconstfunc(rb_mEnumerable)
@@ -97,7 +99,9 @@ void Init_constants_spec(void) {
rb_define_method(cls, "rb_cClass", constants_spec_rb_cClass, 0);
rb_define_method(cls, "rb_cComplex", constants_spec_rb_cComplex, 0);
rb_define_method(cls, "rb_mComparable", constants_spec_rb_mComparable, 0);
+ #ifndef RUBY_VERSION_IS_3_0
rb_define_method(cls, "rb_cData", constants_spec_rb_cData, 0);
+ #endif
rb_define_method(cls, "rb_cDir", constants_spec_rb_cDir, 0);
rb_define_method(cls, "rb_cEncoding", constants_spec_rb_cEncoding, 0);
rb_define_method(cls, "rb_mEnumerable", constants_spec_rb_mEnumerable, 0);
diff --git a/spec/ruby/optional/capi/ext/rubyspec.h b/spec/ruby/optional/capi/ext/rubyspec.h
index 8d75cfcf6f..4f75d40e55 100644
--- a/spec/ruby/optional/capi/ext/rubyspec.h
+++ b/spec/ruby/optional/capi/ext/rubyspec.h
@@ -22,6 +22,10 @@
(RUBY_VERSION_MAJOR == (major) && RUBY_VERSION_MINOR < (minor)) || \
(RUBY_VERSION_MAJOR == (major) && RUBY_VERSION_MINOR == (minor) && RUBY_VERSION_TEENY < (teeny)))
+#if RUBY_VERSION_MAJOR > 3 || (RUBY_VERSION_MAJOR == 3 && RUBY_VERSION_MINOR >= 0)
+#define RUBY_VERSION_IS_3_0
+#endif
+
#if RUBY_VERSION_MAJOR > 2 || (RUBY_VERSION_MAJOR == 2 && RUBY_VERSION_MINOR >= 7)
#define RUBY_VERSION_IS_2_7
#endif