From 714fd78f6721f0c6df58d2fefae6b016424d317e Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 18 Nov 2014 14:58:03 +0000 Subject: * 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 --- debug.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'debug.c') diff --git a/debug.c b/debug.c index 15c1ea8b9e..4eaae0d978 100644 --- a/debug.c +++ b/debug.c @@ -140,18 +140,17 @@ ruby_debug_breakpoint(void) 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); } -- cgit v1.2.3