diff options
Diffstat (limited to 'version.c')
-rw-r--r-- | version.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -47,6 +47,9 @@ static const char ruby_description_with_yjit[] = RUBY_DESCRIPTION_WITH(" +YJIT") const char ruby_copyright[] = RUBY_COPYRIGHT; const char ruby_engine[] = "ruby"; +// Might change after initialization +const char *rb_dynamic_description = ruby_description; + /*! Defines platform-depended Ruby-level constants */ void Init_version(void) @@ -104,9 +107,11 @@ Init_ruby_description(void) VALUE description; if (MJIT_OPTS_ON) { + rb_dynamic_description = ruby_description_with_mjit; description = MKSTR(description_with_mjit); } else if (rb_yjit_enabled_p()) { + rb_dynamic_description = ruby_description_with_yjit; description = MKSTR(description_with_yjit); } else { @@ -122,15 +127,7 @@ Init_ruby_description(void) void ruby_show_version(void) { - if (MJIT_OPTS_ON) { - PRINT(description_with_mjit); - } - else if (rb_yjit_enabled_p()) { - PRINT(description_with_yjit); - } - else { - PRINT(description); - } + puts(rb_dynamic_description); #ifdef RUBY_LAST_COMMIT_TITLE fputs("last_commit=" RUBY_LAST_COMMIT_TITLE, stdout); |