diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-12-22 01:00:43 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-12-22 02:51:49 +0900 |
commit | 8918a9cf6c65409ae1ffcdea324a1b97c6e5bb70 (patch) | |
tree | 21d993f31deddd50f3bc717be2ddce433db0d9f0 /spec/ruby/optional | |
parent | c30f03d32833f38fedf41ecb08f1ade9c6657fef (diff) | |
download | ruby-8918a9cf6c65409ae1ffcdea324a1b97c6e5bb70.tar.gz |
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
Diffstat (limited to 'spec/ruby/optional')
-rw-r--r-- | spec/ruby/optional/capi/ext/constants_spec.c | 4 | ||||
-rw-r--r-- | spec/ruby/optional/capi/ext/rubyspec.h | 4 |
2 files changed, 8 insertions, 0 deletions
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 |