aboutsummaryrefslogtreecommitdiffstats
path: root/version.c
diff options
context:
space:
mode:
Diffstat (limited to 'version.c')
-rw-r--r--version.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/version.c b/version.c
index c5b70b13a7..fc7105f416 100644
--- a/version.c
+++ b/version.c
@@ -33,7 +33,7 @@ const char ruby_release_date[] = RUBY_RELEASE_DATE;
const char ruby_platform[] = RUBY_PLATFORM;
const int ruby_patchlevel = RUBY_PATCHLEVEL;
const char ruby_description[] = RUBY_DESCRIPTION_WITH("");
-const char ruby_description_with_jit[] = RUBY_DESCRIPTION_WITH(" +JIT");
+static const char ruby_description_with_jit[] = RUBY_DESCRIPTION_WITH(" +JIT");
const char ruby_copyright[] = RUBY_COPYRIGHT;
const char ruby_engine[] = "ruby";
@@ -67,11 +67,6 @@ Init_version(void)
*/
rb_define_global_const("RUBY_REVISION", MKINT(revision));
/*
- * The full ruby version string, like <tt>ruby -v</tt> prints'
- * This might be overwritten by mjit_init().
- */
- rb_define_global_const("RUBY_DESCRIPTION", MKSTR(description));
- /*
* The copyright string for ruby
*/
rb_define_global_const("RUBY_COPYRIGHT", MKSTR(copyright));
@@ -86,6 +81,23 @@ Init_version(void)
rb_define_global_const("RUBY_ENGINE_VERSION", (1 ? version : MKSTR(version)));
}
+void
+Init_ruby_description(void)
+{
+ VALUE description;
+
+ if (mjit_opts.on) {
+ description = MKSTR(description_with_jit);
+ }
+ else {
+ description = MKSTR(description);
+ }
+ /*
+ * The full ruby version string, like <tt>ruby -v</tt> prints
+ */
+ rb_define_global_const("RUBY_DESCRIPTION", description);
+}
+
/*! Prints the version information of the CRuby interpreter to stdout. */
void
ruby_show_version(void)