From a44f48cadc8a319e233bc5a8c6ab9d52aaf52bae Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Mon, 19 Sep 2022 10:15:04 -0400 Subject: [ruby/bigdecimal] Remove array defs in missing.h for old Rubies Commit 02b6053 added these to support Ruby 2.0.0. The rb_array_const_ptr function is defined since Ruby 2.3. https://github.com/ruby/bigdecimal/commit/678699ca1b --- ext/bigdecimal/extconf.rb | 1 - ext/bigdecimal/missing.h | 29 ----------------------------- 2 files changed, 30 deletions(-) (limited to 'ext/bigdecimal') diff --git a/ext/bigdecimal/extconf.rb b/ext/bigdecimal/extconf.rb index 4920374b1a..e74196e18b 100644 --- a/ext/bigdecimal/extconf.rb +++ b/ext/bigdecimal/extconf.rb @@ -71,7 +71,6 @@ have_func("rb_rational_num", "ruby.h") have_func("rb_rational_den", "ruby.h") have_func("rb_complex_real", "ruby.h") have_func("rb_complex_imag", "ruby.h") -have_func("rb_array_const_ptr", "ruby.h") have_func("rb_sym2str", "ruby.h") have_func("rb_opts_exception_p", "ruby.h") have_func("rb_category_warn", "ruby.h") diff --git a/ext/bigdecimal/missing.h b/ext/bigdecimal/missing.h index 49b7c7667f..02d2348e4b 100644 --- a/ext/bigdecimal/missing.h +++ b/ext/bigdecimal/missing.h @@ -172,35 +172,6 @@ rb_complex_imag(VALUE cmp) } #endif -/* array */ - -#ifndef FIX_CONST_VALUE_PTR -# if defined(__fcc__) || defined(__fcc_version) || \ - defined(__FCC__) || defined(__FCC_VERSION) -/* workaround for old version of Fujitsu C Compiler (fcc) */ -# define FIX_CONST_VALUE_PTR(x) ((const VALUE *)(x)) -# else -# define FIX_CONST_VALUE_PTR(x) (x) -# endif -#endif - -#ifndef HAVE_RB_ARRAY_CONST_PTR -static inline const VALUE * -rb_array_const_ptr(VALUE a) -{ - return FIX_CONST_VALUE_PTR((RBASIC(a)->flags & RARRAY_EMBED_FLAG) ? - RARRAY(a)->as.ary : RARRAY(a)->as.heap.ptr); -} -#endif - -#ifndef RARRAY_CONST_PTR -# define RARRAY_CONST_PTR(a) rb_array_const_ptr(a) -#endif - -#ifndef RARRAY_AREF -# define RARRAY_AREF(a, i) (RARRAY_CONST_PTR(a)[i]) -#endif - /* symbol */ #ifndef HAVE_RB_SYM2STR -- cgit v1.2.3