summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/missing.h
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-07-14 15:17:35 +0900
committergit <svn-admin@ruby-lang.org>2022-07-14 21:02:02 +0900
commit673759328ca2ff46cc37989dd81c59fe3518e426 (patch)
treef8742a924473635f90b27497afe980f4d4abd699 /ext/bigdecimal/missing.h
parent8b64e8f2ed5833570bd1f46683d2b96c7c98413a (diff)
downloadruby-673759328ca2ff46cc37989dd81c59fe3518e426.tar.gz
[ruby/bigdecimal] Remove checks for `struct RRational` and `struct RComplex`
These are used to see only if `RRATIONAL` and `RCOMPLEX` are available, however, these two are macros and can be checked with `#ifdef` directly. https://github.com/ruby/bigdecimal/commit/175bbacd43
Diffstat (limited to 'ext/bigdecimal/missing.h')
-rw-r--r--ext/bigdecimal/missing.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/bigdecimal/missing.h b/ext/bigdecimal/missing.h
index 7969849158..49b7c7667f 100644
--- a/ext/bigdecimal/missing.h
+++ b/ext/bigdecimal/missing.h
@@ -126,7 +126,7 @@ char *BigDecimal_dtoa(double d_, int mode, int ndigits, int *decpt, int *sign, c
static inline VALUE
rb_rational_num(VALUE rat)
{
-#ifdef HAVE_TYPE_STRUCT_RRATIONAL
+#ifdef RRATIONAL
return RRATIONAL(rat)->num;
#else
return rb_funcall(rat, rb_intern("numerator"), 0);
@@ -138,7 +138,7 @@ rb_rational_num(VALUE rat)
static inline VALUE
rb_rational_den(VALUE rat)
{
-#ifdef HAVE_TYPE_STRUCT_RRATIONAL
+#ifdef RRATIONAL
return RRATIONAL(rat)->den;
#else
return rb_funcall(rat, rb_intern("denominator"), 0);
@@ -152,7 +152,7 @@ rb_rational_den(VALUE rat)
static inline VALUE
rb_complex_real(VALUE cmp)
{
-#ifdef HAVE_TYPE_STRUCT_RCOMPLEX
+#ifdef RCOMPLEX
return RCOMPLEX(cmp)->real;
#else
return rb_funcall(cmp, rb_intern("real"), 0);
@@ -164,7 +164,7 @@ rb_complex_real(VALUE cmp)
static inline VALUE
rb_complex_imag(VALUE cmp)
{
-# ifdef HAVE_TYPE_STRUCT_RCOMPLEX
+# ifdef RCOMPLEX
return RCOMPLEX(cmp)->imag;
# else
return rb_funcall(cmp, rb_intern("imag"), 0);