summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2025-12-24 22:47:02 +0900
committerNARUSE, Yui <naruse@airemix.jp>2025-12-24 22:55:44 +0900
commitba2f6972193cdbd7c1e77e26212513e47926b115 (patch)
tree7dbcf8bf5ffe1e5c41c6cd7d1d1273431ddbe1f6 /ruby.c
parent8de2622c1291afd29a9a570e6b396bbe722360a3 (diff)
Revert "Extract `ruby_api_version_name`"
This reverts commit 9b576cd6255aba97e5e2f55f4b09f00c7dd0e839.
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ruby.c b/ruby.c
index 11376cbe70..36d6ed203b 100644
--- a/ruby.c
+++ b/ruby.c
@@ -61,6 +61,7 @@
#include "ruby/util.h"
#include "ruby/version.h"
#include "ruby/internal/error.h"
+#include "version.h"
#define singlebit_only_p(x) !((x) & ((x)-1))
STATIC_ASSERT(Qnil_1bit_from_Qfalse, singlebit_only_p(Qnil^Qfalse));
@@ -305,8 +306,6 @@ ruby_show_usage_line(const char *name, const char *secondary, const char *descri
description, help, highlight, width, columns);
}
-RUBY_EXTERN const char ruby_api_version_name[];
-
static void
usage(const char *name, int help, int highlight, int columns)
{
@@ -409,9 +408,9 @@ usage(const char *name, int help, int highlight, int columns)
unsigned int w = (columns > 80 ? (columns - 79) / 2 : 0) + 16;
#define SHOW(m) show_usage_line(&(m), help, highlight, w, columns)
- 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);
+ printf("%sUsage:%s %s [options] [--] [filepath] [arguments]\n\n", sb, se, name);
+ printf("Details and examples at https://docs.ruby-lang.org/en/%s/ruby/options_md.html\n",
+ RUBY_PATCHLEVEL == -1 ? "master" : STRINGIZE(RUBY_VERSION_MAJOR) "." STRINGIZE(RUBY_VERSION_MINOR));
for (i = 0; i < num; ++i)
SHOW(usage_msg[i]);