From 87025fdd4345f48821236ff19090976bfc11a2bd Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 15 Oct 2003 02:27:56 +0000 Subject: * marshal.c (w_object): dump extended modules as well. * marshal.c (r_object0): TYPE_USRMARSHAL should restore extended modules before invoking marshal_load. these two fixes are done by Masatoshi Seki . * parse.y (yylex): argument parentheses preceded by spaces should be warned; not error. [ruby-talk:84103] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 13 +++++++++++++ eval.c | 2 +- ext/socket/extconf.rb | 2 +- lib/cgi.rb | 1 + lib/irb/context.rb | 2 +- lib/mkmf.rb | 2 +- marshal.c | 30 +++++++++++++++++++++--------- parse.y | 3 ++- 8 files changed, 41 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index cfc3398b65..45b5460f24 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Wed Oct 15 11:23:05 2003 Yukihiro Matsumoto + + * marshal.c (w_object): dump extended modules as well. + + * marshal.c (r_object0): TYPE_USRMARSHAL should restore extended + modules before invoking marshal_load. these two fixes are done + by Masatoshi Seki . + Wed Oct 15 09:30:34 2003 NAKAMURA Usaku * ext/enumerator/enumerator.c (enumerator_each): avoid VC++ warning. @@ -45,6 +53,11 @@ Wed Oct 15 03:53:20 2003 Hidetoshi NAGAI * ext/tk/lib/tk.rb: fixed trouble on auto-load Tcl commands (enbug on the last commit). +Wed Oct 15 00:25:00 2003 Yukihiro Matsumoto + + * parse.y (yylex): argument parentheses preceded by spaces should + be warned; not error. [ruby-talk:84103] + Wed Oct 15 00:20:15 2003 Hidetoshi NAGAI * ext/tcltklib/tcltklib.c: replace Tcl/Tk's vwait and tkwait to diff --git a/eval.c b/eval.c index d2963dfd10..0161d23c16 100644 --- a/eval.c +++ b/eval.c @@ -1332,7 +1332,7 @@ ruby_finalize_0(ex) void ruby_finalize() { - ruby_finalize_0(0); + ruby_finalize_0(EXIT_SUCCESS); } int diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb index 0fcb392690..4f7b49407f 100644 --- a/ext/socket/extconf.rb +++ b/ext/socket/extconf.rb @@ -319,7 +319,7 @@ end $objs = ["socket.#{$OBJEXT}"] -if $getaddr_info_ok and have_func("getaddrinfo") and have_func("getnameinfo") +if $getaddr_info_ok and have_func("getaddrinfo", "netdb.h") and have_func("getnameinfo", "netdb.h") have_getaddrinfo = true else if try_link(<len > 0) { + m = rb_ary_pop(extended); + rb_extend_object(v, m); + } } break; @@ -996,7 +1002,7 @@ r_object0(arg, proc, ivp) if (FL_TEST(c, FL_SINGLETON)) { rb_raise(rb_eTypeError, "singleton can't be loaded"); } - v = r_object0(arg, 0, 0); + v = r_object0(arg, 0, 0, extended); if (rb_special_const_p(v) || TYPE(v) == T_OBJECT || TYPE(v) == T_CLASS) { format_error: rb_raise(rb_eArgError, "dump format error (user class)"); @@ -1200,6 +1206,12 @@ r_object0(arg, proc, ivp) VALUE data; v = rb_obj_alloc(klass); + if (! NIL_P(extended)) { + while (RARRAY(extended)->len > 0) { + VALUE m = rb_ary_pop(extended); + rb_extend_object(v, m); + } + } if (!rb_respond_to(v, s_mload)) { rb_raise(rb_eTypeError, "instance of %s needs to have method `marshal_load'", rb_class2name(klass)); @@ -1246,7 +1258,7 @@ r_object0(arg, proc, ivp) "class %s needs to have instance method `_load_data'", rb_class2name(klass)); } - rb_funcall(v, s_load_data, 1, r_object0(arg, 0, 0)); + rb_funcall(v, s_load_data, 1, r_object0(arg, 0, 0, extended)); } break; @@ -1298,7 +1310,7 @@ static VALUE r_object(arg) struct load_arg *arg; { - return r_object0(arg, arg->proc, 0); + return r_object0(arg, arg->proc, 0, Qnil); } static VALUE diff --git a/parse.y b/parse.y index 93d395717e..2b466a997f 100644 --- a/parse.y +++ b/parse.y @@ -4029,7 +4029,8 @@ yylex() c = tLPAREN_ARG; } else if (lex_state == EXPR_ARG) { - c = tLPAREN_ARG; + rb_warn("don't put space before argument parentheses"); + c = '('; } } COND_PUSH(0); -- cgit v1.2.3