summaryrefslogtreecommitdiff
path: root/version.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-11 08:07:49 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-11 08:07:49 (GMT)
commit8ab36f0306a511881fb008bd1c60abd7918dae46 (patch)
treef320f2fcfd9e1e0f61fe4539a67cef259d5153ec /version.c
parent0991d0a8ee73977ab3e2aed2fbe361985f6f0d0d (diff)
fake.rb.in: scan version.c
* template/fake.rb.in: scan MKSTR and MKINT from version.c and then extract the value for them from version.i. * version.c (Init_version): use MKINT as the marker. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'version.c')
-rw-r--r--version.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/version.c b/version.c
index 7297189..0aafa92 100644
--- a/version.c
+++ b/version.c
@@ -19,6 +19,7 @@
#define PRINT(type) puts(ruby_##type)
#define MKSTR(type) rb_obj_freeze(rb_usascii_str_new_static(ruby_##type, sizeof(ruby_##type)-1))
+#define MKINT(name) INT2FIX(ruby_##name)
const int ruby_api_version[] = {
RUBY_API_VERSION_MAJOR,
@@ -38,6 +39,8 @@ VALUE ruby_engine_name = Qnil;
void
Init_version(void)
{
+ enum {ruby_patchlevel = RUBY_PATCHLEVEL};
+ enum {ruby_revision = RUBY_REVISION};
VALUE version;
/*
* The running version of ruby
@@ -55,11 +58,11 @@ Init_version(void)
* The patchlevel for this ruby. If this is a development build of ruby
* the patchlevel will be -1
*/
- rb_define_global_const("RUBY_PATCHLEVEL", INT2FIX(RUBY_PATCHLEVEL));
+ rb_define_global_const("RUBY_PATCHLEVEL", MKINT(patchlevel));
/*
* The SVN revision for this ruby.
*/
- rb_define_global_const("RUBY_REVISION", INT2FIX(RUBY_REVISION));
+ rb_define_global_const("RUBY_REVISION", MKINT(revision));
/*
* The full ruby version string, like <tt>ruby -v</tt> prints'
*/