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

ruby-changes:36396

From: akr <ko1@a...>
Date: Tue, 18 Nov 2014 23:58:08 +0900 (JST)
Subject: [ruby-changes:36396] akr:r48477 (trunk): * debug.c (SET_WHEN): Don't declare debug variables here.

akr	2014-11-18 23:58:03 +0900 (Tue, 18 Nov 2014)

  New Revision: 48477

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48477

  Log:
    * debug.c (SET_WHEN): Don't declare debug variables here.
      ruby_initial_gc_stress_ptr is changed int* to VALUE* at r41406.
    
    * internal.h (ruby_initial_gc_stress_ptr): Declared.
      (ruby_enable_coredump): Ditto.

  Modified files:
    trunk/ChangeLog
    trunk/debug.c
    trunk/internal.h
Index: debug.c
===================================================================
--- debug.c	(revision 48476)
+++ debug.c	(revision 48477)
@@ -140,18 +140,17 @@ ruby_debug_breakpoint(void) https://github.com/ruby/ruby/blob/trunk/debug.c#L140
 static void
 set_debug_option(const char *str, int len, void *arg)
 {
-#define SET_WHEN(name, var) do {	    \
+#define SET_WHEN(name, var, val) do {	    \
 	if (len == sizeof(name) - 1 &&	    \
 	    strncmp(str, (name), len) == 0) { \
-	    extern int var;	    \
-	    var = 1;		    \
+	    (var) = (val);		    \
 	    return;			    \
 	}				    \
     } while (0)
-    SET_WHEN("gc_stress", *ruby_initial_gc_stress_ptr);
-    SET_WHEN("core", ruby_enable_coredump);
+    SET_WHEN("gc_stress", *ruby_initial_gc_stress_ptr, Qtrue);
+    SET_WHEN("core", ruby_enable_coredump, 1);
 #if defined _WIN32 && defined _MSC_VER && _MSC_VER >= 1400
-    SET_WHEN("rtc_error", ruby_w32_rtc_error);
+    SET_WHEN("rtc_error", ruby_w32_rtc_error, 1);
 #endif
     fprintf(stderr, "unexpected debug option: %.*s\n", len, str);
 }
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 48476)
+++ ChangeLog	(revision 48477)
@@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Nov 18 23:45:52 2014  Tanaka Akira  <akr@f...>
+
+	* debug.c (SET_WHEN): Don't declare debug variables here.
+	  ruby_initial_gc_stress_ptr is changed int* to VALUE* at r41406.
+
+	* internal.h (ruby_initial_gc_stress_ptr): Declared.
+	  (ruby_enable_coredump): Ditto.
+
 Tue Nov 18 18:06:43 2014  Tanaka Akira  <akr@f...>
 
 	* include/ruby/io.h (FMODE_WSPLIT): Removed.  The write() system call
Index: internal.h
===================================================================
--- internal.h	(revision 48476)
+++ internal.h	(revision 48477)
@@ -645,6 +645,7 @@ NORETURN(void rb_syserr_fail_path_in(con https://github.com/ruby/ruby/blob/trunk/internal.h#L645
 #endif
 
 /* gc.c */
+extern VALUE *ruby_initial_gc_stress_ptr;
 void Init_heap(void);
 void *ruby_mimmalloc(size_t size);
 void ruby_mimfree(void *ptr);
@@ -911,6 +912,7 @@ long rb_reg_search0(VALUE, VALUE, long, https://github.com/ruby/ruby/blob/trunk/internal.h#L912
 void rb_backref_set_string(VALUE string, long pos, long len);
 
 /* signal.c */
+extern int ruby_enable_coredump;
 int rb_get_next_signal(void);
 int rb_sigaltstack_size(void);
 

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

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