12#include "internal/cmdlineopt.h"
25# if RUBY_PATCHLEVEL == -1
26# ifndef RUBY_BRANCH_NAME
27# define RUBY_BRANCH_NAME "master"
29# define RUBY_REVISION_STR " "RUBY_BRANCH_NAME" "RUBY_REVISION
31# define RUBY_REVISION_STR " revision "RUBY_REVISION
34# define RUBY_REVISION "HEAD"
35# define RUBY_REVISION_STR ""
37#if !defined RUBY_RELEASE_DATETIME || RUBY_PATCHLEVEL != -1
38# undef RUBY_RELEASE_DATETIME
39# define RUBY_RELEASE_DATETIME RUBY_RELEASE_DATE
42# define RUBY_DESCRIPTION_WITH(opt) \
43 "ruby " RUBY_VERSION RUBY_PATCHLEVEL_STR " " \
44 "(" RUBY_RELEASE_DATETIME RUBY_REVISION_STR ")" opt " " \
47#define PRINT(type) puts(ruby_##type)
48#define MKSTR(type) rb_obj_freeze(rb_usascii_str_new_static(ruby_##type, sizeof(ruby_##type)-1))
49#define MKINT(name) INT2FIX(ruby_##name)
57 STRINGIZE(RUBY_VERSION_MAJOR) "." \
58 STRINGIZE(RUBY_VERSION_MINOR) "." \
59 STRINGIZE(RUBY_VERSION_TEENY) ""
60#ifndef RUBY_FULL_REVISION
61# define RUBY_FULL_REVISION RUBY_REVISION
64#define YJIT_DESCRIPTION " +YJIT " STRINGIZE(YJIT_SUPPORT)
66#define YJIT_DESCRIPTION " +YJIT"
69const char ruby_revision[] = RUBY_FULL_REVISION;
74static const char ruby_description_with_mjit[] = RUBY_DESCRIPTION_WITH(
" +MJIT");
75static const char ruby_description_with_yjit[] = RUBY_DESCRIPTION_WITH(YJIT_DESCRIPTION);
77 RUBY_BIRTH_YEAR_STR
"-" RUBY_RELEASE_YEAR_STR
" "
90 VALUE ruby_engine_name;
130#define MJIT_OPTS_ON opt->mjit.on
132#define MJIT_OPTS_ON 0
136#define YJIT_OPTS_ON opt->yjit
138#define YJIT_OPTS_ON 0
147 rb_dynamic_description = ruby_description_with_mjit;
148 description = MKSTR(description_with_mjit);
150 else if (YJIT_OPTS_ON) {
151 rb_dynamic_description = ruby_description_with_yjit;
152 description = MKSTR(description_with_yjit);
155 description = MKSTR(description);
167 puts(rb_dynamic_description);
169#ifdef RUBY_LAST_COMMIT_TITLE
170 fputs(
"last_commit=" RUBY_LAST_COMMIT_TITLE, stdout);
172#ifdef HAVE_MALLOC_CONF
173 if (malloc_conf) printf(
"malloc_conf=%s\n", malloc_conf);
void ruby_set_script_name(VALUE name)
Identical to ruby_script(), except it takes the name as a Ruby String instance.
void ruby_show_copyright(void)
Prints the copyright notice of the CRuby interpreter to stdout.
void ruby_show_version(void)
Prints the version information of the CRuby interpreter to stdout.
void rb_provide(const char *feature)
Declares that the given feature is already provided by someone else.
void rb_define_global_const(const char *name, VALUE val)
Identical to rb_define_const(), except it defines that of "global", i.e.
const int ruby_api_version[3]
API versions, in { major, minor, teeny } order.
const char ruby_engine[]
This is just "ruby" for us.
#define RUBY_API_VERSION_TEENY
Teeny version.
const char ruby_platform[]
Target platform identifier, in a C string.
const char ruby_version[]
Stringised version.
#define RUBY_API_VERSION_MAJOR
Major version.
#define RUBY_API_VERSION_MINOR
Minor version.
#define RUBY_AUTHOR
Author of this project.
const char ruby_copyright[]
Copyright notice.
const char ruby_release_date[]
Date of release, in a C string.
const int ruby_patchlevel
This is a monotonic increasing integer that describes specific "patch" level.
const char ruby_description[]
This is what ruby -v prints to the standard error.
uintptr_t VALUE
Type that represents a Ruby object.