mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 12:14:51 +00:00
Reapply "Extract ruby_api_version_name"
This reverts commit ba2f6972193cdbd7c1e77e26212513e47926b115. Box already used ruby_api_version_name.
This commit is contained in:
parent
285e22edc5
commit
29ffc5d624
5
ruby.c
5
ruby.c
@ -305,6 +305,8 @@ ruby_show_usage_line(const char *name, const char *secondary, const char *descri
|
|||||||
description, help, highlight, width, columns);
|
description, help, highlight, width, columns);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RUBY_EXTERN const char ruby_api_version_name[];
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage(const char *name, int help, int highlight, int columns)
|
usage(const char *name, int help, int highlight, int columns)
|
||||||
{
|
{
|
||||||
@ -408,6 +410,9 @@ usage(const char *name, int help, int highlight, int columns)
|
|||||||
#define SHOW(m) show_usage_line(&(m), help, highlight, w, columns)
|
#define SHOW(m) show_usage_line(&(m), help, highlight, w, columns)
|
||||||
|
|
||||||
printf("%sUsage:%s %s [options] [--] [filepath] [arguments]\n", sb, se, name);
|
printf("%sUsage:%s %s [options] [--] [filepath] [arguments]\n", sb, se, name);
|
||||||
|
printf("\n""Details and examples at https://docs.ruby-lang.org/en/%s/ruby/options_md.html\n",
|
||||||
|
ruby_api_version_name);
|
||||||
|
|
||||||
for (i = 0; i < num; ++i)
|
for (i = 0; i < num; ++i)
|
||||||
SHOW(usage_msg[i]);
|
SHOW(usage_msg[i]);
|
||||||
|
|
||||||
|
|||||||
10
version.c
10
version.c
@ -25,8 +25,9 @@
|
|||||||
|
|
||||||
#ifdef RUBY_REVISION
|
#ifdef RUBY_REVISION
|
||||||
# if RUBY_PATCHLEVEL == -1
|
# if RUBY_PATCHLEVEL == -1
|
||||||
|
# define RUBY_API_VERSION_NAME "master"
|
||||||
# ifndef RUBY_BRANCH_NAME
|
# ifndef RUBY_BRANCH_NAME
|
||||||
# define RUBY_BRANCH_NAME "master"
|
# define RUBY_BRANCH_NAME RUBY_API_VERSION_NAME
|
||||||
# endif
|
# endif
|
||||||
# define RUBY_REVISION_STR " "RUBY_BRANCH_NAME" "RUBY_REVISION
|
# define RUBY_REVISION_STR " "RUBY_BRANCH_NAME" "RUBY_REVISION
|
||||||
# else
|
# else
|
||||||
@ -36,6 +37,9 @@
|
|||||||
# define RUBY_REVISION "HEAD"
|
# define RUBY_REVISION "HEAD"
|
||||||
# define RUBY_REVISION_STR ""
|
# define RUBY_REVISION_STR ""
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef RUBY_API_VERSION_NAME
|
||||||
|
# define RUBY_API_VERSION_NAME RUBY_API_VERSION_STR
|
||||||
|
#endif
|
||||||
#if !defined RUBY_RELEASE_DATETIME || RUBY_PATCHLEVEL != -1
|
#if !defined RUBY_RELEASE_DATETIME || RUBY_PATCHLEVEL != -1
|
||||||
# undef RUBY_RELEASE_DATETIME
|
# undef RUBY_RELEASE_DATETIME
|
||||||
# define RUBY_RELEASE_DATETIME RUBY_RELEASE_DATE
|
# define RUBY_RELEASE_DATETIME RUBY_RELEASE_DATE
|
||||||
@ -45,6 +49,9 @@
|
|||||||
#define MKSTR(type) rb_obj_freeze(rb_usascii_str_new_static(ruby_##type, sizeof(ruby_##type)-1))
|
#define MKSTR(type) rb_obj_freeze(rb_usascii_str_new_static(ruby_##type, sizeof(ruby_##type)-1))
|
||||||
#define MKINT(name) INT2FIX(ruby_##name)
|
#define MKINT(name) INT2FIX(ruby_##name)
|
||||||
|
|
||||||
|
#define RUBY_API_VERSION_STR \
|
||||||
|
STRINGIZE(RUBY_API_VERSION_MAJOR) "." \
|
||||||
|
STRINGIZE(RUBY_API_VERSION_MINOR)
|
||||||
const int ruby_api_version[] = {
|
const int ruby_api_version[] = {
|
||||||
RUBY_API_VERSION_MAJOR,
|
RUBY_API_VERSION_MAJOR,
|
||||||
RUBY_API_VERSION_MINOR,
|
RUBY_API_VERSION_MINOR,
|
||||||
@ -77,6 +84,7 @@ const char ruby_revision[] = RUBY_FULL_REVISION;
|
|||||||
const char ruby_release_date[] = RUBY_RELEASE_DATE;
|
const char ruby_release_date[] = RUBY_RELEASE_DATE;
|
||||||
const char ruby_platform[] = RUBY_PLATFORM;
|
const char ruby_platform[] = RUBY_PLATFORM;
|
||||||
const int ruby_patchlevel = RUBY_PATCHLEVEL;
|
const int ruby_patchlevel = RUBY_PATCHLEVEL;
|
||||||
|
const char ruby_api_version_name[] = RUBY_API_VERSION_NAME;
|
||||||
const char ruby_description[] =
|
const char ruby_description[] =
|
||||||
"ruby " RUBY_VERSION RUBY_PATCHLEVEL_STR " "
|
"ruby " RUBY_VERSION RUBY_PATCHLEVEL_STR " "
|
||||||
"(" RUBY_RELEASE_DATETIME RUBY_REVISION_STR ") "
|
"(" RUBY_RELEASE_DATETIME RUBY_REVISION_STR ") "
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user