summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2024-03-21 16:22:46 -0400
committerPeter Zhu <[email protected]>2024-03-26 10:02:17 -0400
commit19752cf4aa227106212be129507ac1bf339b26c0 ()
tree810a2320d68ef0b044b5699285b70612b3815b15
parente9152bc9da39ad864b755e7bcc682610f8035a98 (diff)
Use macro SET_WHEN_UINT
-rw-r--r--debug.c19
1 files changed, 8 insertions, 11 deletions
@@ -219,7 +219,11 @@ ruby_env_debug_option(const char *str, int len, void *arg)
} \
} while (0)
#define SET_WHEN_UINT(name, vals, num, req) \
- if (NAME_MATCH_VALUE(name)) SET_UINT_LIST(name, vals, num);
if (NAME_MATCH("gc_stress")) {
rb_gc_stress_set(Qtrue);
@@ -227,22 +231,15 @@ ruby_env_debug_option(const char *str, int len, void *arg)
}
SET_WHEN("core", ruby_enable_coredump, 1);
SET_WHEN("ci", ruby_on_ci, 1);
- if (NAME_MATCH_VALUE("rgengc")) {
- if (!len) ruby_rgengc_debug = 1;
- else SET_UINT_LIST("rgengc", &ruby_rgengc_debug, 1);
- return 1;
- }
#if defined _WIN32
# if RUBY_MSVCRT_VERSION >= 80
SET_WHEN("rtc_error", ruby_w32_rtc_error, 1);
# endif
#endif
#if defined _WIN32 || defined __CYGWIN__
- if (NAME_MATCH_VALUE("codepage")) {
- if (!len) fprintf(stderr, "missing codepage argument");
- else SET_UINT_LIST("codepage", ruby_w32_codepage, numberof(ruby_w32_codepage));
- return 1;
- }
#endif
return 0;
}