* 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.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2014-11-18 14:58:03 +00:00
parent 8463a90871
commit 714fd78f67
3 changed files with 15 additions and 6 deletions

View File

@ -1,3 +1,11 @@
Tue Nov 18 23:45:52 2014 Tanaka Akira <akr@fsij.org>
* 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@fsij.org> Tue Nov 18 18:06:43 2014 Tanaka Akira <akr@fsij.org>
* include/ruby/io.h (FMODE_WSPLIT): Removed. The write() system call * include/ruby/io.h (FMODE_WSPLIT): Removed. The write() system call

11
debug.c
View File

@ -140,18 +140,17 @@ ruby_debug_breakpoint(void)
static void static void
set_debug_option(const char *str, int len, void *arg) 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 && \ if (len == sizeof(name) - 1 && \
strncmp(str, (name), len) == 0) { \ strncmp(str, (name), len) == 0) { \
extern int var; \ (var) = (val); \
var = 1; \
return; \ return; \
} \ } \
} while (0) } while (0)
SET_WHEN("gc_stress", *ruby_initial_gc_stress_ptr); SET_WHEN("gc_stress", *ruby_initial_gc_stress_ptr, Qtrue);
SET_WHEN("core", ruby_enable_coredump); SET_WHEN("core", ruby_enable_coredump, 1);
#if defined _WIN32 && defined _MSC_VER && _MSC_VER >= 1400 #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 #endif
fprintf(stderr, "unexpected debug option: %.*s\n", len, str); fprintf(stderr, "unexpected debug option: %.*s\n", len, str);
} }

View File

@ -645,6 +645,7 @@ NORETURN(void rb_syserr_fail_path_in(const char *func_name, int err, VALUE path)
#endif #endif
/* gc.c */ /* gc.c */
extern VALUE *ruby_initial_gc_stress_ptr;
void Init_heap(void); void Init_heap(void);
void *ruby_mimmalloc(size_t size); void *ruby_mimmalloc(size_t size);
void ruby_mimfree(void *ptr); void ruby_mimfree(void *ptr);
@ -911,6 +912,7 @@ long rb_reg_search0(VALUE, VALUE, long, int, int);
void rb_backref_set_string(VALUE string, long pos, long len); void rb_backref_set_string(VALUE string, long pos, long len);
/* signal.c */ /* signal.c */
extern int ruby_enable_coredump;
int rb_get_next_signal(void); int rb_get_next_signal(void);
int rb_sigaltstack_size(void); int rb_sigaltstack_size(void);