aboutsummaryrefslogtreecommitdiffstats
path: root/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c11
1 files changed, 5 insertions, 6 deletions
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);
}