summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-03 12:21:18 (GMT)
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-03 12:21:18 (GMT)
commitf5b06413cabbedfdd320eb36c68577db8fa99c4f (patch)
tree77ff499058ed2eed2430344ca123a4b8111db00e /rational.c
parent9977e1cbc799fc1710e65d7978b39a65e75f38b7 (diff)
* marshal.c: calls directly rb_{Complex,Rational}_marshal_load().
But now disabled. [experimental] * complex.c: followed the above. * rational.c: ditto. * include/rub/intern.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/rational.c b/rational.c
index 248fcda..6fda5a2 100644
--- a/rational.c
+++ b/rational.c
@@ -1632,6 +1632,21 @@ nurat_marshal_load(VALUE self, VALUE a)
return self;
}
+#ifdef MARSHAL_LOAD_DIRECT
+/* :nodoc: */
+static VALUE
+nurat_marshal_load_fake(VALUE self, VALUE a)
+{
+ rb_raise(rb_eNotImpError, "not implemented");
+}
+
+ VALUE
+rb_Rational_marshal_load(VALUE obj, VALUE a)
+{
+ return nurat_marshal_load(obj, a);
+}
+#endif
+
#ifdef MARSHAL_OLD_STYLE
/* :nodoc: */
static VALUE
@@ -2393,6 +2408,7 @@ Init_Rational(void)
rb_define_method(rb_cRational, "to_s", nurat_to_s, 0);
rb_define_method(rb_cRational, "inspect", nurat_inspect, 0);
+#ifndef MARSHAL_LOAD_DIRECT
#ifndef MARSHAL_OLD_STYLE
rb_define_method(rb_cRational, "marshal_dump", nurat_marshal_dump, 0);
rb_define_method(rb_cRational, "marshal_load", nurat_marshal_load, 1);
@@ -2400,6 +2416,10 @@ Init_Rational(void)
rb_define_method(rb_cRational, "_dump", nurat_marshal__dump, 1);
rb_define_singleton_method(rb_cRational, "_load", nurat_marshal__load, 1);
#endif
+#else
+ rb_define_method(rb_cRational, "marshal_dump", nurat_marshal_dump, 0);
+ rb_define_method(rb_cRational, "marshal_load", nurat_marshal_load_fake, 1);
+#endif
/* --- */