summaryrefslogtreecommitdiff
path: root/internal/complex.h
diff options
context:
space:
mode:
Diffstat (limited to 'internal/complex.h')
-rw-r--r--internal/complex.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/complex.h b/internal/complex.h
index 7a363fc..0a8ecfb 100644
--- a/internal/complex.h
+++ b/internal/complex.h
@@ -9,6 +9,7 @@
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
*/
+#include "ruby/ruby.h" /* for struct RBasic */
struct RComplex {
struct RBasic basic;
@@ -19,8 +20,8 @@ struct RComplex {
#define RCOMPLEX(obj) (R_CAST(RComplex)(obj))
/* shortcut macro for internal only */
-#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))
+#define RCOMPLEX_SET_REAL(cmp, r) RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->real, (r))
+#define RCOMPLEX_SET_IMAG(cmp, i) RB_OBJ_WRITE((cmp), &RCOMPLEX(cmp)->imag, (i))
/* complex.c */
VALUE rb_dbl_complex_new_polar_pi(double abs, double ang);