From 8918a9cf6c65409ae1ffcdea324a1b97c6e5bb70 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 22 Dec 2020 01:00:43 +0900 Subject: 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 --- spec/ruby/core/data/constants_spec.rb | 2 +- spec/ruby/optional/capi/ext/constants_spec.c | 4 ++++ spec/ruby/optional/capi/ext/rubyspec.h | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'spec/ruby') 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 -- cgit v1.2.3