summaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-23 04:41:27 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-23 04:41:27 +0000
commit62bfc4f24e6cddda37461347e884c094080259ea (patch)
treef270eb17e619fac0d1bce7b757df2ce07e07c824 /internal.h
parent6adcf6a898cd8d6becfebd0ee1a881e9bc77c3be (diff)
* include/ruby/ruby.h (struct RComplex): no longer. [Feature #9888]
* include/ruby/ruby.h (RCOMPLEX): ditto. * include/ruby/ruby.h (RCOMPLEX_SET_REAL): deprecated. Will be deleted later. * include/ruby/ruby.h (RCOMPLEX_SET_IMAG): ditto. * internal.h (struct RFloat): moved here. * internal.h (RCOMPLEX): ditto. * complex.c (rb_complex_set_real): do not use this. * complex.c (rb_complex_set_imag): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index db4961dea4..3f0fd30122 100644
--- a/internal.h
+++ b/internal.h
@@ -427,6 +427,21 @@ struct RFloat {
#define RFLOAT(obj) (R_CAST(RFloat)(obj))
+struct RComplex {
+ struct RBasic basic;
+ const VALUE real;
+ const VALUE imag;
+};
+
+#define RCOMPLEX(obj) (R_CAST(RComplex)(obj))
+
+#ifdef RCOMPLEX_SET_REAL /* shortcut macro for internal only */
+#undef RCOMPLEX_SET_REAL
+#undef RCOMPLEX_SET_REAL
+#define RCOMPLEX_SET_REAL(cmp, r) RB_OBJ_WRITE((cmp), &((struct RComplex *)(cmp))->real,(r))
+#define RCOMPLEX_SET_IMAG(cmp, i) RB_OBJ_WRITE((cmp), &((struct RComplex *)(cmp))->imag,(i))
+#endif
+
/* class.c */
void rb_class_subclass_add(VALUE super, VALUE klass);
void rb_class_remove_from_super_subclasses(VALUE);