ext/ox/dump.c in ox-1.4.1 vs ext/ox/dump.c in ox-1.4.2
- old
+ new
@@ -695,11 +695,11 @@
rb_ivar_foreach(obj, dump_var, (VALUE)out);
out->depth = od;
out->w_end(out, &e);
}
#else
-#ifdef JRUBY
+#if (defined JRUBY || defined RBX_Qnil)
VALUE vars = rb_funcall2(obj, rb_intern("instance_variables"), 0, 0);
#else
VALUE vars = rb_obj_instance_variables(obj);
#endif
e.type = ObjectCode;
@@ -783,19 +783,19 @@
dump_value(out, StringValuePtr(rs), RSTRING_LEN(rs));
e.indent = -1;
out->w_end(out, &e);
break;
}
-#ifdef T_COMPLEX
+#if (defined T_COMPLEX && defined RCOMPLEX)
case T_COMPLEX:
e.type = ComplexCode;
out->w_start(out, &e);
dump_obj(0, RCOMPLEX(obj)->real, depth + 1, out);
dump_obj(0, RCOMPLEX(obj)->imag, depth + 1, out);
out->w_end(out, &e);
break;
#endif
-#ifdef T_RATIONAL
+#if (defined T_RATIONAL && defined RRATIONAL)
case T_RATIONAL:
e.type = RationalCode;
out->w_start(out, &e);
dump_obj(0, RRATIONAL(obj)->num, depth + 1, out);
dump_obj(0, RRATIONAL(obj)->den, depth + 1, out);