mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
58e65141fd
commit
c4ae288b90
4 changed files with 45 additions and 9 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
Sat May 31 22:11:15 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
|
||||||
|
|
||||||
|
* version.c (ruby_description, ruby_copyright): backported from
|
||||||
|
1.9. bug#19002, [ruby-dev:34883]
|
||||||
|
|
||||||
|
* error.c (report_bug): uses ruby_description.
|
||||||
|
|
||||||
Sat May 31 20:56:04 2008 Akinori MUSHA <knu@iDaemons.org>
|
Sat May 31 20:56:04 2008 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* array.c (rb_ary_delete_if): should return enumerator if no block
|
* array.c (rb_ary_delete_if): should return enumerator if no block
|
||||||
|
|
6
error.c
6
error.c
|
@ -29,8 +29,7 @@
|
||||||
#define EXIT_SUCCESS 0
|
#define EXIT_SUCCESS 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern const char ruby_version[], ruby_release_date[], ruby_platform[];
|
extern const char *ruby_description;
|
||||||
extern const int ruby_patchlevel;
|
|
||||||
|
|
||||||
int ruby_nerrs;
|
int ruby_nerrs;
|
||||||
|
|
||||||
|
@ -209,8 +208,7 @@ rb_bug(fmt, va_alist)
|
||||||
va_init_list(args, fmt);
|
va_init_list(args, fmt);
|
||||||
vfprintf(out, fmt, args);
|
vfprintf(out, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
fprintf(out, "\nruby %s (%s patchlevel %d) [%s]\n\n",
|
fprintf(out, "\n%s\n\n", ruby_description);
|
||||||
ruby_version, ruby_release_date, ruby_patchlevel, ruby_platform);
|
|
||||||
}
|
}
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
31
version.c
31
version.c
|
@ -14,23 +14,44 @@
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define PRINT(type) puts(ruby_##type)
|
||||||
|
#define MKSTR(type) rb_obj_freeze(rb_str_new(ruby_##type, sizeof(ruby_##type)-1))
|
||||||
|
|
||||||
const char ruby_version[] = RUBY_VERSION;
|
const char ruby_version[] = RUBY_VERSION;
|
||||||
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_description;
|
||||||
|
const char *ruby_copyright;
|
||||||
|
|
||||||
void
|
void
|
||||||
Init_version()
|
Init_version()
|
||||||
{
|
{
|
||||||
VALUE v = rb_obj_freeze(rb_str_new2(ruby_version));
|
static char description[128];
|
||||||
VALUE d = rb_obj_freeze(rb_str_new2(ruby_release_date));
|
static char copyright[128];
|
||||||
VALUE p = rb_obj_freeze(rb_str_new2(ruby_platform));
|
VALUE v = MKSTR(version);
|
||||||
|
VALUE d = MKSTR(release_date);
|
||||||
|
VALUE p = MKSTR(platform);
|
||||||
|
VALUE tmp;
|
||||||
|
|
||||||
rb_define_global_const("RUBY_VERSION", v);
|
rb_define_global_const("RUBY_VERSION", v);
|
||||||
rb_define_global_const("RUBY_RELEASE_DATE", d);
|
rb_define_global_const("RUBY_RELEASE_DATE", d);
|
||||||
rb_define_global_const("RUBY_PLATFORM", p);
|
rb_define_global_const("RUBY_PLATFORM", p);
|
||||||
rb_define_global_const("RUBY_PATCHLEVEL", INT2FIX(RUBY_PATCHLEVEL));
|
rb_define_global_const("RUBY_PATCHLEVEL", INT2FIX(RUBY_PATCHLEVEL));
|
||||||
|
|
||||||
|
snprintf(description, sizeof(description), "ruby %s (%s %s %d) [%s]",
|
||||||
|
RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_RELEASE_STR,
|
||||||
|
RUBY_RELEASE_NUM, RUBY_PLATFORM);
|
||||||
|
ruby_description = description;
|
||||||
|
tmp = rb_obj_freeze(rb_str_new2(description));
|
||||||
|
rb_define_global_const("RUBY_DESCRIPTION", tmp);
|
||||||
|
|
||||||
|
snprintf(copyright, sizeof(copyright), "ruby - Copyright (C) %d-%d %s",
|
||||||
|
RUBY_BIRTH_YEAR, RUBY_RELEASE_YEAR, RUBY_AUTHOR);
|
||||||
|
ruby_copyright = copyright;
|
||||||
|
tmp = rb_obj_freeze(rb_str_new2(copyright));
|
||||||
|
rb_define_global_const("RUBY_COPYRIGHT", tmp);
|
||||||
|
|
||||||
/* obsolete constants */
|
/* obsolete constants */
|
||||||
rb_define_global_const("VERSION", v);
|
rb_define_global_const("VERSION", v);
|
||||||
rb_define_global_const("RELEASE_DATE", d);
|
rb_define_global_const("RELEASE_DATE", d);
|
||||||
|
@ -40,13 +61,13 @@ Init_version()
|
||||||
void
|
void
|
||||||
ruby_show_version()
|
ruby_show_version()
|
||||||
{
|
{
|
||||||
printf("ruby %s (%s patchlevel %d) [%s]\n", RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PATCHLEVEL, RUBY_PLATFORM);
|
PRINT(description);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ruby_show_copyright()
|
ruby_show_copyright()
|
||||||
{
|
{
|
||||||
printf("ruby - Copyright (C) 1993-%d Yukihiro Matsumoto\n", RUBY_RELEASE_YEAR);
|
PRINT(copyright);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
10
version.h
10
version.h
|
@ -16,4 +16,14 @@ RUBY_EXTERN const char ruby_version[];
|
||||||
RUBY_EXTERN const char ruby_release_date[];
|
RUBY_EXTERN const char ruby_release_date[];
|
||||||
RUBY_EXTERN const char ruby_platform[];
|
RUBY_EXTERN const char ruby_platform[];
|
||||||
RUBY_EXTERN const int ruby_patchlevel;
|
RUBY_EXTERN const int ruby_patchlevel;
|
||||||
|
RUBY_EXTERN const char *ruby_description;
|
||||||
|
RUBY_EXTERN const char *ruby_copyright;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define RUBY_AUTHOR "Yukihiro Matsumoto"
|
||||||
|
#define RUBY_BIRTH_YEAR 1993
|
||||||
|
#define RUBY_BIRTH_MONTH 2
|
||||||
|
#define RUBY_BIRTH_DAY 24
|
||||||
|
|
||||||
|
#define RUBY_RELEASE_STR "patchlevel"
|
||||||
|
#define RUBY_RELEASE_NUM RUBY_PATCHLEVEL
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue