[前][次][番号順一覧][スレッド一覧]

ruby-changes:3315

From: ko1@a...
Date: 31 Dec 2007 07:39:46 +0900
Subject: [ruby-changes:3315] nobu - Ruby:r14808 (trunk): * main.c, goruby.c (RUBY_MAIN_INIT): removed.

nobu	2007-12-31 07:39:34 +0900 (Mon, 31 Dec 2007)

  New Revision: 14808

  Modified files:
    trunk/ChangeLog
    trunk/goruby.c
    trunk/main.c

  Log:
    * main.c, goruby.c (RUBY_MAIN_INIT): removed.
    
    * goruby.c (goruby_run_node): run after ruby_init_loadpath() so that
      require works, and protect the call.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14808&r2=14807
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/goruby.c?r1=14808&r2=14807
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/main.c?r1=14808&r2=14807

Index: goruby.c
===================================================================
--- goruby.c	(revision 14807)
+++ goruby.c	(revision 14808)
@@ -1,3 +1,24 @@
 void Init_golf(void); 
-#define RUBY_MAIN_INIT() Init_golf()
+#define ruby_run_node goruby_run_node
 #include "main.c"
+#undef ruby_run_node
+
+RUBY_EXTERN int ruby_run_node(void*);
+RUBY_EXTERN void ruby_init_ext(const char *name, void (*init)(void));
+
+static VALUE
+init_golf(VALUE arg)
+{
+    ruby_init_ext("golf", Init_golf);
+    return arg;
+}
+
+int
+goruby_run_node(void *arg)
+{
+    int state;
+    if (NIL_P(rb_protect(init_golf, Qtrue, &state))) {
+	return state == EXIT_SUCCESS ? EXIT_FAILURE : state;
+    }
+    return ruby_run_node(arg);
+}
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 14807)
+++ ChangeLog	(revision 14808)
@@ -1,3 +1,10 @@
+Mon Dec 31 07:39:31 2007  Nobuyoshi Nakada  <nobu@r...>
+
+	* main.c, goruby.c (RUBY_MAIN_INIT): removed.
+
+	* goruby.c (goruby_run_node): run after ruby_init_loadpath() so that
+	  require works, and protect the call.
+
 Mon Dec 31 06:50:38 2007  Nobuyoshi Nakada  <nobu@r...>
 
 	* trunk/common.mk: not use -I$(srcdir)/lib with $(MINIRUBY) for cross
Index: main.c
===================================================================
--- main.c	(revision 14807)
+++ main.c	(revision 14808)
@@ -33,9 +33,6 @@
     {
 	RUBY_INIT_STACK;
 	ruby_init();
-#ifdef RUBY_MAIN_INIT
-	RUBY_MAIN_INIT();
-#endif
 	return ruby_run_node(ruby_options(argc, argv));
     }
 }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧]