зеркало из https://github.com/github/ruby.git
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
31c53aaa7d
Коммит
0e47c138c9
24
ChangeLog
24
ChangeLog
|
@ -2,6 +2,30 @@ Thu Dec 21 13:01:46 2000 Tanaka Akira <akr@m17n.org>
|
||||||
|
|
||||||
* lib/net/ftp.rb (makeport): don't use TCPsocket.getaddress.
|
* lib/net/ftp.rb (makeport): don't use TCPsocket.getaddress.
|
||||||
|
|
||||||
|
Wed Dec 20 12:00:15 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* bignum.c (rb_big_lshift): should cast up to BDIGIT_DBL.
|
||||||
|
|
||||||
|
* parse.y (yylex): disallow trailin '_' for numeric litrals.
|
||||||
|
|
||||||
|
* bignum.c (rb_cstr2inum): allow `_' within converting string.
|
||||||
|
|
||||||
|
* eval.c (specific_eval): should take no argument if block is
|
||||||
|
supplied.
|
||||||
|
|
||||||
|
Tue Dec 19 13:44:50 2000 K.Kosako <kosako@sofnec.co.jp>
|
||||||
|
|
||||||
|
* io.c (rb_f_p): should flush rb_defout, not stdout.
|
||||||
|
|
||||||
|
Tue Dec 19 00:57:10 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* time.c (time_minus): usec might overflow (ruby-bugs-ja:#PR#35).
|
||||||
|
|
||||||
|
* eval.c (rb_obj_extend): Object#extend should take at least one
|
||||||
|
argument.
|
||||||
|
|
||||||
|
* parse.y (mrhs_basic): should check value_expr($3), not $1.
|
||||||
|
|
||||||
Mon Dec 18 23:18:39 2000 WATANABE Hirofumi <eban@ruby-lang.org>
|
Mon Dec 18 23:18:39 2000 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||||
|
|
||||||
* util.c (mblen, __crt0_glob_function): add for multibyte
|
* util.c (mblen, __crt0_glob_function): add for multibyte
|
||||||
|
|
12
bignum.c
12
bignum.c
|
@ -231,7 +231,9 @@ rb_cstr2inum(str, base)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (base == 8) {
|
if (base == 8) {
|
||||||
while (str[0] == '0') str++;
|
while (*str == '0') str++;
|
||||||
|
if (!*str) return INT2FIX(0);
|
||||||
|
while (*str == '_') str++;
|
||||||
len = 3*strlen(str)*sizeof(char);
|
len = 3*strlen(str)*sizeof(char);
|
||||||
}
|
}
|
||||||
else { /* base == 10, 2 or 16 */
|
else { /* base == 10, 2 or 16 */
|
||||||
|
@ -249,6 +251,7 @@ rb_cstr2inum(str, base)
|
||||||
if (len <= (sizeof(VALUE)*CHAR_BIT)) {
|
if (len <= (sizeof(VALUE)*CHAR_BIT)) {
|
||||||
unsigned long val = strtoul((char*)str, &end, base);
|
unsigned long val = strtoul((char*)str, &end, base);
|
||||||
|
|
||||||
|
if (*end == '_') goto bigparse;
|
||||||
if (badcheck) {
|
if (badcheck) {
|
||||||
if (end == str) goto bad; /* no number */
|
if (end == str) goto bad; /* no number */
|
||||||
while (*end && ISSPACE(*end)) end++;
|
while (*end && ISSPACE(*end)) end++;
|
||||||
|
@ -271,7 +274,9 @@ rb_cstr2inum(str, base)
|
||||||
return big;
|
return big;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
bigparse:
|
||||||
len = (len/BITSPERDIG)+1;
|
len = (len/BITSPERDIG)+1;
|
||||||
|
if (badcheck && *str == '_') goto bad;
|
||||||
|
|
||||||
z = bignew(len, sign);
|
z = bignew(len, sign);
|
||||||
zds = BDIGITS(z);
|
zds = BDIGITS(z);
|
||||||
|
@ -290,6 +295,8 @@ rb_cstr2inum(str, base)
|
||||||
case 'D': case 'E': case 'F':
|
case 'D': case 'E': case 'F':
|
||||||
c = c - 'A' + 10;
|
c = c - 'A' + 10;
|
||||||
break;
|
break;
|
||||||
|
case '_':
|
||||||
|
continue;
|
||||||
default:
|
default:
|
||||||
if (badcheck) {
|
if (badcheck) {
|
||||||
if (ISSPACE(c)) {
|
if (ISSPACE(c)) {
|
||||||
|
@ -317,6 +324,7 @@ rb_cstr2inum(str, base)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (badcheck && s+2 < str && str[-2] == '_') goto bad;
|
||||||
|
|
||||||
return bignorm(z);
|
return bignorm(z);
|
||||||
}
|
}
|
||||||
|
@ -1252,7 +1260,7 @@ rb_big_lshift(x, y)
|
||||||
}
|
}
|
||||||
xds = BDIGITS(x);
|
xds = BDIGITS(x);
|
||||||
for (i=0; i<len; i++) {
|
for (i=0; i<len; i++) {
|
||||||
num = num | *xds++<<s2;
|
num = num | (BDIGIT_DBL)*xds++<<s2;
|
||||||
*zds++ = BIGLO(num);
|
*zds++ = BIGLO(num);
|
||||||
num = BIGDN(num);
|
num = BIGDN(num);
|
||||||
}
|
}
|
||||||
|
|
50
eval.c
50
eval.c
|
@ -4943,33 +4943,34 @@ specific_eval(argc, argv, klass, self)
|
||||||
VALUE *argv;
|
VALUE *argv;
|
||||||
VALUE klass, self;
|
VALUE klass, self;
|
||||||
{
|
{
|
||||||
char *file = "(eval)";
|
if (rb_block_given_p()) {
|
||||||
int line = 1;
|
if (argc > 0) {
|
||||||
int iter = rb_block_given_p();
|
rb_raise(rb_eArgError, "wrong # of arguments (%d for 0)", argc);
|
||||||
|
|
||||||
if (argc > 0) {
|
|
||||||
if (ruby_safe_level >= 4) {
|
|
||||||
Check_Type(argv[0], T_STRING);
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
Check_SafeStr(argv[0]);
|
|
||||||
}
|
|
||||||
if (argc > 3) {
|
|
||||||
rb_raise(rb_eArgError, "wrong # of arguments: %s(src) or %s{..}",
|
|
||||||
rb_id2name(ruby_frame->last_func),
|
|
||||||
rb_id2name(ruby_frame->last_func));
|
|
||||||
}
|
|
||||||
if (argc > 1) file = STR2CSTR(argv[1]);
|
|
||||||
if (argc > 2) line = NUM2INT(argv[2]);
|
|
||||||
}
|
|
||||||
else if (!iter) {
|
|
||||||
rb_raise(rb_eArgError, "block not supplied");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (iter) {
|
|
||||||
return yield_under(klass, self);
|
return yield_under(klass, self);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
char *file = "(eval)";
|
||||||
|
int line = 1;
|
||||||
|
|
||||||
|
if (argc == 0) {
|
||||||
|
rb_raise(rb_eArgError, "block not supplied");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (ruby_safe_level >= 4) {
|
||||||
|
Check_Type(argv[0], T_STRING);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Check_SafeStr(argv[0]);
|
||||||
|
}
|
||||||
|
if (argc > 3) {
|
||||||
|
rb_raise(rb_eArgError, "wrong # of arguments: %s(src) or %s{..}",
|
||||||
|
rb_id2name(ruby_frame->last_func),
|
||||||
|
rb_id2name(ruby_frame->last_func));
|
||||||
|
}
|
||||||
|
if (argc > 1) file = STR2CSTR(argv[1]);
|
||||||
|
if (argc > 2) line = NUM2INT(argv[2]);
|
||||||
|
}
|
||||||
return eval_under(klass, self, argv[0], file, line);
|
return eval_under(klass, self, argv[0], file, line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5551,6 +5552,9 @@ rb_obj_extend(argc, argv, obj)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (argc == 0) {
|
||||||
|
rb_raise(rb_eArgError, "wrong # of arguments(0 for 1)");
|
||||||
|
}
|
||||||
for (i=0; i<argc; i++) Check_Type(argv[i], T_MODULE);
|
for (i=0; i<argc; i++) Check_Type(argv[i], T_MODULE);
|
||||||
for (i=0; i<argc; i++) {
|
for (i=0; i<argc; i++) {
|
||||||
rb_funcall(argv[i], rb_intern("extend_object"), 1, obj);
|
rb_funcall(argv[i], rb_intern("extend_object"), 1, obj);
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#! /usr/local/bin/ruby
|
#! /usr/local/bin/ruby
|
||||||
|
# -*- ruby -*-
|
||||||
|
|
||||||
$".push 'mkmf.rb'
|
$".push 'mkmf.rb'
|
||||||
|
ORIG_LIBPATH = ENV['LIB']
|
||||||
|
|
||||||
if ARGV[0] == 'static'
|
if ARGV[0] == 'static'
|
||||||
$force_static = true
|
$force_static = true
|
||||||
|
@ -90,7 +92,19 @@ def try_link0(src, opt="")
|
||||||
cfile = open("conftest.c", "w")
|
cfile = open("conftest.c", "w")
|
||||||
cfile.print src
|
cfile.print src
|
||||||
cfile.close
|
cfile.close
|
||||||
xsystem(format(LINK, $CFLAGS, $CPPFLAGS, $LDFLAGS, opt, $LOCAL_LIBS))
|
ldflags = $LDFLAGS
|
||||||
|
if /mswin32/ =~ RUBY_PLATFORM and !$LIBPATH.empty?
|
||||||
|
ENV['LIB'] = ($LIBPATH + [ORIG_LIBPATH]).compact.join(';')
|
||||||
|
else
|
||||||
|
$LDFLAGS = ldflags.dup
|
||||||
|
$LIBPATH.each {|d| $LDFLAGS << " -L" + d}
|
||||||
|
end
|
||||||
|
begin
|
||||||
|
xsystem(format(LINK, $CFLAGS, $CPPFLAGS, $LDFLAGS, opt, $LOCAL_LIBS))
|
||||||
|
ensure
|
||||||
|
$LDFLAGS = ldflags
|
||||||
|
ENV['LIB'] = ORIG_LIBPATH if /mswin32/ =~ RUBY_PLATFORM
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def try_link(src, opt="")
|
def try_link(src, opt="")
|
||||||
|
@ -205,17 +219,17 @@ SRC
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_library(lib, func, *paths)
|
def find_library(lib, func, *paths)
|
||||||
ldflags = $LDFLAGS
|
libpath = $LIBPATH
|
||||||
libs = append_library($libs, lib)
|
libs = append_library($libs, lib)
|
||||||
until try_link(<<"SRC", libs)
|
until try_link(<<"SRC", libs)
|
||||||
int main() { return 0; }
|
int main() { return 0; }
|
||||||
int t() { #{func}(); return 0; }
|
int t() { #{func}(); return 0; }
|
||||||
SRC
|
SRC
|
||||||
if paths.size == 0
|
if paths.size == 0
|
||||||
$LDFLAGS = ldflags
|
$LIBPATH = libpath
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
$LDFLAGS = ldflags + " -L"+paths.shift
|
$LIBPATH = libpath | [paths.shift]
|
||||||
end
|
end
|
||||||
$libs = libs
|
$libs = libs
|
||||||
return true
|
return true
|
||||||
|
@ -270,7 +284,7 @@ def arg_config(config, default=nil)
|
||||||
$configure_args = {}
|
$configure_args = {}
|
||||||
args = "@configure_args@"
|
args = "@configure_args@"
|
||||||
if /mswin32|mingw/ =~ RUBY_PLATFORM and ENV["CONFIGURE_ARGS"]
|
if /mswin32|mingw/ =~ RUBY_PLATFORM and ENV["CONFIGURE_ARGS"]
|
||||||
args = args + " " + ENV["CONFIGURE_ARGS"]
|
args << " " << ENV["CONFIGURE_ARGS"]
|
||||||
end
|
end
|
||||||
for arg in args.split
|
for arg in args.split
|
||||||
next unless /^--/ =~ arg
|
next unless /^--/ =~ arg
|
||||||
|
@ -321,19 +335,18 @@ def dir_config(target, idefault=nil, ldefault=nil)
|
||||||
dir = with_config("%s-dir"%target, default)
|
dir = with_config("%s-dir"%target, default)
|
||||||
if dir
|
if dir
|
||||||
idir = " -I"+dir+"/include"
|
idir = " -I"+dir+"/include"
|
||||||
ldir = " -L"+dir+"/lib"
|
ldir = dir+"/lib"
|
||||||
end
|
end
|
||||||
unless idir
|
unless idir
|
||||||
dir = with_config("%s-include"%target, idefault)
|
dir = with_config("%s-include"%target, idefault)
|
||||||
idir = " -I"+dir if dir
|
idir = " -I"+dir if dir
|
||||||
end
|
end
|
||||||
unless ldir
|
unless ldir
|
||||||
dir = with_config("%s-lib"%target, ldefault)
|
ldir = with_config("%s-lib"%target, ldefault)
|
||||||
ldir = " -L"+dir if dir
|
|
||||||
end
|
end
|
||||||
|
|
||||||
$CFLAGS += idir if idir
|
$CPPFLAGS += idir if idir
|
||||||
$LDFLAGS += ldir if ldir
|
$LIBPATH |= [ldir] if ldir
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_makefile(target)
|
def create_makefile(target)
|
||||||
|
@ -355,9 +368,9 @@ def create_makefile(target)
|
||||||
|
|
||||||
$DLDFLAGS = '@DLDFLAGS@'
|
$DLDFLAGS = '@DLDFLAGS@'
|
||||||
|
|
||||||
if $configure_args['--enable-shared'] or /cygwin|mingw/ === RUBY_PLATFORM
|
if $configure_args['--enable-shared'] or "@LIBRUBY@" != "@LIBRUBY_A@"
|
||||||
$libs = "@LIBRUBYARG@ " + $libs
|
$libs = "@LIBRUBYARG@ " + $libs
|
||||||
$DLDFLAGS = $DLDFLAGS + " -L" + $topdir
|
$LIBPATH |= [$topdir]
|
||||||
end
|
end
|
||||||
|
|
||||||
defflag = ''
|
defflag = ''
|
||||||
|
@ -368,6 +381,12 @@ def create_makefile(target)
|
||||||
defflag = "--def=" + target + ".def"
|
defflag = "--def=" + target + ".def"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if RUBY_PLATFORM =~ /mswin32/
|
||||||
|
libpath = $LIBPATH.join(';')
|
||||||
|
else
|
||||||
|
$LIBPATH.each {|d| $DLDFLAGS << " -L" << d}
|
||||||
|
end
|
||||||
|
|
||||||
$srcdir = $top_srcdir + "/ext/" + $mdir
|
$srcdir = $top_srcdir + "/ext/" + $mdir
|
||||||
mfile = open("Makefile", "w")
|
mfile = open("Makefile", "w")
|
||||||
mfile.binmode if /mingw/ =~ RUBY_PLATFORM
|
mfile.binmode if /mingw/ =~ RUBY_PLATFORM
|
||||||
|
@ -389,6 +408,9 @@ CPPFLAGS = -I$(topdir) -I$(hdrdir) -I@includedir@ %s #$CPPFLAGS
|
||||||
DLDFLAGS = #$DLDFLAGS #$LDFLAGS
|
DLDFLAGS = #$DLDFLAGS #$LDFLAGS
|
||||||
LDSHARED = @LDSHARED@ #{defflag}
|
LDSHARED = @LDSHARED@ #{defflag}
|
||||||
", if $static then "" else "@CCDLFLAGS@" end, $defs.join(" ")
|
", if $static then "" else "@CCDLFLAGS@" end, $defs.join(" ")
|
||||||
|
mfile.puts "LIBPATH = #{libpath}" if libpath
|
||||||
|
|
||||||
|
mfile.puts ".SUFFIXES: .@OBJEXT@" unless "@OBJEXT@" == "o"
|
||||||
|
|
||||||
mfile.printf "\
|
mfile.printf "\
|
||||||
|
|
||||||
|
@ -425,9 +447,8 @@ archdir = $(pkglibdir)/@arch@
|
||||||
mfile.printf "\n"
|
mfile.printf "\n"
|
||||||
|
|
||||||
ruby_interpreter = "$(topdir)/miniruby@EXEEXT@"
|
ruby_interpreter = "$(topdir)/miniruby@EXEEXT@"
|
||||||
if /mswin32/ =~ RUBY_PLATFORM
|
if /nmake/i =~ $make
|
||||||
ruby_interpreter = $topdir + "/miniruby@EXEEXT@"
|
ruby_interpreter = '$(topdir:/=\)\miniruby@EXEEXT@'
|
||||||
ruby_interpreter.gsub!("/", "\\")
|
|
||||||
end
|
end
|
||||||
if defined? CROSS_COMPILING
|
if defined? CROSS_COMPILING
|
||||||
ruby_interpreter = "@MINIRUBY@"
|
ruby_interpreter = "@MINIRUBY@"
|
||||||
|
@ -467,18 +488,23 @@ EOS
|
||||||
install_rb(mfile, $srcdir)
|
install_rb(mfile, $srcdir)
|
||||||
mfile.printf "\n"
|
mfile.printf "\n"
|
||||||
|
|
||||||
if /mswin32/ =~ RUBY_PLATFORM
|
if /mswin32/ !~ RUBY_PLATFORM
|
||||||
mfile.puts "
|
|
||||||
.c.obj:
|
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
|
|
||||||
{$(srcdir)}.c{}.obj:
|
|
||||||
$(CC) -I. -I$(<D) $(CFLAGS) $(CPPFLAGS) -c $(<:/=\\)
|
|
||||||
|
|
||||||
"
|
|
||||||
else
|
|
||||||
mfile.puts "
|
mfile.puts "
|
||||||
.c.@OBJEXT@:
|
.c.@OBJEXT@:
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
|
$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
|
||||||
|
"
|
||||||
|
elsif /nmake/i =~ $make
|
||||||
|
mfile.print "
|
||||||
|
{$(srcdir)}.c{}.@OBJEXT@:
|
||||||
|
$(CC) -I. -I$(<D) $(CFLAGS) $(CPPFLAGS) -c $(<:/=\\)
|
||||||
|
|
||||||
|
.c.@OBJEXT@:
|
||||||
|
$(CC) $(CFLAGS) $(CPPFLAGS) -c $(<:/=\\)
|
||||||
|
"
|
||||||
|
else
|
||||||
|
mfile.print "
|
||||||
|
.c.@OBJEXT@:
|
||||||
|
$(CC) $(CFLAGS) $(CPPFLAGS) -c $(subst /,\\\\,$<)
|
||||||
"
|
"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -496,10 +522,15 @@ $(DLLIB): $(OBJS)
|
||||||
"
|
"
|
||||||
end
|
end
|
||||||
elsif "@DLEXT@" != $OBJEXT
|
elsif "@DLEXT@" != $OBJEXT
|
||||||
mfile.printf "\
|
mfile.print "$(DLLIB): $(OBJS)\n"
|
||||||
$(DLLIB): $(OBJS)
|
if /mswin32/ =~ RUBY_PLATFORM
|
||||||
$(LDSHARED) $(DLDFLAGS) -o $(DLLIB) $(OBJS) $(LIBS) $(LOCAL_LIBS)
|
if /nmake/i =~ $make
|
||||||
"
|
mfile.print "\tset LIB=$(LIBPATH:/=\\);$(LIB)\n"
|
||||||
|
else
|
||||||
|
mfile.print "\tenv LIB='$(subst /,\\\\,$(LIBPATH));$(LIB)' \\\n"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
mfile.print "\t$(LDSHARED) $(DLDFLAGS) -o $(DLLIB) $(OBJS) $(LIBS) $(LOCAL_LIBS)\n"
|
||||||
elsif RUBY_PLATFORM == "m68k-human"
|
elsif RUBY_PLATFORM == "m68k-human"
|
||||||
mfile.printf "\
|
mfile.printf "\
|
||||||
$(DLLIB): $(OBJS)
|
$(DLLIB): $(OBJS)
|
||||||
|
@ -517,7 +548,7 @@ $(DLLIB): $(OBJS)
|
||||||
mfile.printf "###\n"
|
mfile.printf "###\n"
|
||||||
while line = dfile.gets()
|
while line = dfile.gets()
|
||||||
line.gsub!(/\.o\b/, ".#{$OBJEXT}")
|
line.gsub!(/\.o\b/, ".#{$OBJEXT}")
|
||||||
line.gsub!(/(\s)([^\s\/]+\.[ch])/, '\1$(srcdir)/\2') if /mswin32/ =~ RUBY_PLATFORM
|
line.gsub!(/(\s)([^\s\/]+\.[ch])/, '\1$(srcdir)/\2') if /nmake/i =~ $make
|
||||||
mfile.printf "%s", line.gsub('\$\(hdrdir\)/config.h', '$(topdir)/config.h')
|
mfile.printf "%s", line.gsub('\$\(hdrdir\)/config.h', '$(topdir)/config.h')
|
||||||
end
|
end
|
||||||
dfile.close
|
dfile.close
|
||||||
|
@ -543,26 +574,26 @@ def extmake(target)
|
||||||
$local_flags = ""
|
$local_flags = ""
|
||||||
if /mswin32/ =~ RUBY_PLATFORM
|
if /mswin32/ =~ RUBY_PLATFORM
|
||||||
$LIBEXT = "lib"
|
$LIBEXT = "lib"
|
||||||
$local_flags = "$(topdir)/$(RUBY_SO_NAME).lib -link /EXPORT:Init_$(TARGET)"
|
$local_flags = "-link /INCREMENTAL:no /EXPORT:Init_$(TARGET)"
|
||||||
end
|
end
|
||||||
$LOCAL_LIBS = "" # to be assigned in extconf.rb
|
$LOCAL_LIBS = "" # to be assigned in extconf.rb
|
||||||
dir = with_config("opt-dir")
|
dir = with_config("opt-dir")
|
||||||
if dir
|
if dir
|
||||||
idir = "-I"+dir+"/include"
|
idir = "-I"+dir+"/include"
|
||||||
ldir = "-L"+dir+"/lib"
|
ldir = dir+"/lib"
|
||||||
end
|
end
|
||||||
unless idir
|
unless idir
|
||||||
dir = with_config("opt-include")
|
dir = with_config("opt-include")
|
||||||
idir = "-I"+dir if dir
|
idir = "-I"+dir if dir
|
||||||
end
|
end
|
||||||
unless ldir
|
unless ldir
|
||||||
dir = with_config("opt-lib")
|
ldir = with_config("opt-lib")
|
||||||
ldir = "-L"+dir if dir
|
|
||||||
end
|
end
|
||||||
|
|
||||||
$CFLAGS = ""
|
$CFLAGS = ""
|
||||||
$CPPFLAGS = idir || ""
|
$CPPFLAGS = idir || ""
|
||||||
$LDFLAGS = ldir || ""
|
$LDFLAGS = ""
|
||||||
|
$LIBPATH = [ldir].compact
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Dir.mkdir target unless File.directory?(target)
|
Dir.mkdir target unless File.directory?(target)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
require 'mkmf'
|
require 'mkmf'
|
||||||
$LDFLAGS += " -L/usr/local/lib" if File.directory?("/usr/local/lib")
|
|
||||||
$CFLAGS += " -Dss_family=__ss_family -Dss_len=__ss_len"
|
$LIBPATH << "/usr/local/lib" if File.directory?("/usr/local/lib")
|
||||||
|
$CPPFLAGS += " -Dss_family=__ss_family -Dss_len=__ss_len"
|
||||||
|
|
||||||
case RUBY_PLATFORM
|
case RUBY_PLATFORM
|
||||||
when /mswin32|mingw/
|
when /mswin32|mingw/
|
||||||
|
|
1
gc.c
1
gc.c
|
@ -411,7 +411,6 @@ rb_gc_mark(ptr)
|
||||||
register RVALUE *obj = RANY(ptr);
|
register RVALUE *obj = RANY(ptr);
|
||||||
|
|
||||||
Top:
|
Top:
|
||||||
if (FIXNUM_P(obj)) return; /* fixnum not marked */
|
|
||||||
if (rb_special_const_p((VALUE)obj)) return; /* special const not marked */
|
if (rb_special_const_p((VALUE)obj)) return; /* special const not marked */
|
||||||
if (obj->as.basic.flags == 0) return; /* free cell */
|
if (obj->as.basic.flags == 0) return; /* free cell */
|
||||||
if (obj->as.basic.flags & FL_MARK) return; /* already marked */
|
if (obj->as.basic.flags & FL_MARK) return; /* already marked */
|
||||||
|
|
2
io.c
2
io.c
|
@ -2156,7 +2156,7 @@ rb_f_p(argc, argv)
|
||||||
for (i=0; i<argc; i++) {
|
for (i=0; i<argc; i++) {
|
||||||
rb_p(argv[i]);
|
rb_p(argv[i]);
|
||||||
}
|
}
|
||||||
fflush(stdout);
|
rb_io_flush(rb_defout);
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
123
lib/mkmf.rb
123
lib/mkmf.rb
|
@ -5,6 +5,7 @@ require 'rbconfig'
|
||||||
require 'find'
|
require 'find'
|
||||||
|
|
||||||
CONFIG = Config::MAKEFILE_CONFIG
|
CONFIG = Config::MAKEFILE_CONFIG
|
||||||
|
ORIG_LIBPATH = ENV['LIB']
|
||||||
|
|
||||||
SRC_EXT = ["c", "cc", "m", "cxx", "cpp", "C"]
|
SRC_EXT = ["c", "cc", "m", "cxx", "cpp", "C"]
|
||||||
|
|
||||||
|
@ -25,7 +26,7 @@ else
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
$topdir = $hdrdir
|
$topdir = $hdrdir
|
||||||
$hdrdir.gsub!('/', '\\') if RUBY_PLATFORM =~ /mswin32/
|
# $hdrdir.gsub!('/', '\\') if RUBY_PLATFORM =~ /mswin32/
|
||||||
|
|
||||||
CFLAGS = CONFIG["CFLAGS"]
|
CFLAGS = CONFIG["CFLAGS"]
|
||||||
if RUBY_PLATFORM == "m68k-human"
|
if RUBY_PLATFORM == "m68k-human"
|
||||||
|
@ -75,7 +76,19 @@ def try_link0(src, opt="")
|
||||||
cfile = open("conftest.c", "w")
|
cfile = open("conftest.c", "w")
|
||||||
cfile.print src
|
cfile.print src
|
||||||
cfile.close
|
cfile.close
|
||||||
xsystem(format(LINK, $CFLAGS, $LDFLAGS, opt, $LOCAL_LIBS))
|
ldflags = $LDFLAGS
|
||||||
|
if /mswin32/ =~ RUBY_PLATFORM and !$LIBPATH.empty?
|
||||||
|
ENV['LIB'] = ($LIBPATH + [ORIG_LIBPATH]).compact.join(';')
|
||||||
|
else
|
||||||
|
$LDFLAGS = ldflags.dup
|
||||||
|
$LIBPATH.each {|d| $LDFLAGS << " -L" + d}
|
||||||
|
end
|
||||||
|
begin
|
||||||
|
xsystem(format(LINK, $CFLAGS, $CPPFLAGS, $LDFLAGS, opt, $LOCAL_LIBS))
|
||||||
|
ensure
|
||||||
|
$LDFLAGS = ldflags
|
||||||
|
ENV['LIB'] = ORIG_LIBPATH if /mswin32/ =~ RUBY_PLATFORM
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def try_link(src, opt="")
|
def try_link(src, opt="")
|
||||||
|
@ -198,18 +211,18 @@ def find_library(lib, func, *paths)
|
||||||
printf "checking for %s() in -l%s... ", func, lib
|
printf "checking for %s() in -l%s... ", func, lib
|
||||||
STDOUT.flush
|
STDOUT.flush
|
||||||
|
|
||||||
ldflags = $LDFLAGS
|
libpath = $LIBPATH
|
||||||
libs = append_library($libs, lib)
|
libs = append_library($libs, lib)
|
||||||
until try_link(<<"SRC", libs)
|
until try_link(<<"SRC", libs)
|
||||||
int main() { return 0; }
|
int main() { return 0; }
|
||||||
int t() { #{func}(); return 0; }
|
int t() { #{func}(); return 0; }
|
||||||
SRC
|
SRC
|
||||||
if paths.size == 0
|
if paths.size == 0
|
||||||
$LDFLAGS = ldflags
|
$LIBPATH = libpath
|
||||||
print "no\n"
|
print "no\n"
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
$LDFLAGS = ldflags + " -L"+paths.shift
|
$LIBPATH = libpath | [paths.shift]
|
||||||
end
|
end
|
||||||
$libs = libs
|
$libs = libs
|
||||||
print "yes\n"
|
print "yes\n"
|
||||||
|
@ -264,7 +277,7 @@ SRC
|
||||||
print "no\n"
|
print "no\n"
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
header.tr!("a-z\055./", "A-Z___")
|
header.tr!("a-z./\055", "A-Z___")
|
||||||
$defs.push(format("-DHAVE_%s", header))
|
$defs.push(format("-DHAVE_%s", header))
|
||||||
print "yes\n"
|
print "yes\n"
|
||||||
return true
|
return true
|
||||||
|
@ -324,22 +337,21 @@ def dir_config(target, idefault=nil, ldefault=nil)
|
||||||
dir = with_config("%s-dir"%target, default)
|
dir = with_config("%s-dir"%target, default)
|
||||||
if dir
|
if dir
|
||||||
idir = " -I"+dir+"/include"
|
idir = " -I"+dir+"/include"
|
||||||
ldir = " -L"+dir+"/lib"
|
ldir = dir+"/lib"
|
||||||
end
|
end
|
||||||
unless idir
|
unless idir
|
||||||
dir = with_config("%s-include"%target, idefault)
|
dir = with_config("%s-include"%target, idefault)
|
||||||
idir = " -I"+dir if dir
|
idir = " -I"+dir if dir
|
||||||
end
|
end
|
||||||
unless ldir
|
unless ldir
|
||||||
dir = with_config("%s-lib"%target, ldefault)
|
ldir = with_config("%s-lib"%target, ldefault)
|
||||||
ldir = " -L"+dir if dir
|
|
||||||
end
|
end
|
||||||
|
|
||||||
$CFLAGS += idir if idir
|
$CPPFLAGS += idir if idir
|
||||||
$LDFLAGS += ldir if ldir
|
$LIBPATH |= [ldir] if ldir
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_makefile(target)
|
def create_makefile(target, srcdir = File.dirname($0))
|
||||||
print "creating Makefile\n"
|
print "creating Makefile\n"
|
||||||
rm_f "conftest*"
|
rm_f "conftest*"
|
||||||
STDOUT.flush
|
STDOUT.flush
|
||||||
|
@ -358,9 +370,9 @@ def create_makefile(target)
|
||||||
end
|
end
|
||||||
$DLDFLAGS = CONFIG["DLDFLAGS"]
|
$DLDFLAGS = CONFIG["DLDFLAGS"]
|
||||||
|
|
||||||
if $configure_args['--enable-shared'] or /cygwin|mingw/ == RUBY_PLATFORM
|
if $configure_args['--enable-shared'] or CONFIG['LIBRUBY'] != CONFIG['LIBRUBY_A']
|
||||||
$libs = CONFIG["LIBRUBYARG"] + " " + $libs
|
$libs = CONFIG["LIBRUBYARG"] + " " + $libs
|
||||||
$DLDFLAGS += " -L" + CONFIG["libdir"]
|
$LIBPATH |= ["$(topdir)", CONFIG["libdir"]]
|
||||||
end
|
end
|
||||||
|
|
||||||
defflag = ''
|
defflag = ''
|
||||||
|
@ -371,9 +383,16 @@ def create_makefile(target)
|
||||||
defflag = "--def=" + target + ".def"
|
defflag = "--def=" + target + ".def"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if RUBY_PLATFORM =~ /mswin32/
|
||||||
|
libpath = $LIBPATH.join(';')
|
||||||
|
else
|
||||||
|
$LIBPATH.each {|d| $DLDFLAGS << " -L" << d}
|
||||||
|
end
|
||||||
|
drive = File::PATH_SEPARATOR == ';' ? /\A\w:/ : /\A/
|
||||||
|
|
||||||
unless $objs then
|
unless $objs then
|
||||||
$objs = []
|
$objs = []
|
||||||
for f in Dir["*.{#{SRC_EXT.join(%q{,})}}"]
|
for f in Dir[File.join(srcdir || ".", "*.{#{SRC_EXT.join(%q{,})}}")]
|
||||||
f = File.basename(f)
|
f = File.basename(f)
|
||||||
f.sub!(/(#{SRC_EXT.join(%q{|})})$/, $OBJEXT)
|
f.sub!(/(#{SRC_EXT.join(%q{|})})$/, $OBJEXT)
|
||||||
$objs.push f
|
$objs.push f
|
||||||
|
@ -392,27 +411,35 @@ SHELL = /bin/sh
|
||||||
|
|
||||||
#### Start of system configuration section. ####
|
#### Start of system configuration section. ####
|
||||||
|
|
||||||
srcdir = #{$srcdir}
|
srcdir = #{srcdir || $srcdir}
|
||||||
topdir = #{$topdir}
|
topdir = #{$topdir}
|
||||||
hdrdir = #{$hdrdir}
|
hdrdir = #{$hdrdir}
|
||||||
|
VPATH = $(srcdir)
|
||||||
|
|
||||||
CC = #{CONFIG["CC"]}
|
CC = #{CONFIG["CC"]}
|
||||||
|
|
||||||
CFLAGS = #{CONFIG["CCDLFLAGS"]} #{CFLAGS} #{$CFLAGS}
|
CFLAGS = #{CONFIG["CCDLFLAGS"]} #{CFLAGS} #{$CFLAGS}
|
||||||
CPPFLAGS = -I$(hdrdir) -I#{CONFIG["includedir"]} #{$defs.join(" ")} #{CONFIG["CPPFLAGS"]}
|
CPPFLAGS = -I$(hdrdir) -I#{CONFIG["includedir"]} #{$defs.join(" ")} #{CONFIG["CPPFLAGS"]} #{$CPPFLAGS}
|
||||||
CXXFLAGS = $(CFLAGS)
|
CXXFLAGS = $(CFLAGS)
|
||||||
DLDFLAGS = #{$DLDFLAGS} #{$LDFLAGS}
|
DLDFLAGS = #{$DLDFLAGS} #{$LDFLAGS}
|
||||||
LDSHARED = #{CONFIG["LDSHARED"]} #{defflag}
|
LDSHARED = #{CONFIG["LDSHARED"]} #{defflag}
|
||||||
|
LIBPATH = #{libpath}
|
||||||
|
|
||||||
RUBY_INSTALL_NAME = #{CONFIG["RUBY_INSTALL_NAME"]}
|
RUBY_INSTALL_NAME = #{CONFIG["RUBY_INSTALL_NAME"]}
|
||||||
RUBY_SO_NAME = #{CONFIG["RUBY_SO_NAME"]}
|
RUBY_SO_NAME = #{CONFIG["RUBY_SO_NAME"]}
|
||||||
|
#{
|
||||||
prefix = $(DESTDIR)#{CONFIG["prefix"]}
|
if destdir = CONFIG["prefix"].scan(drive)[0] and !destdir.empty?
|
||||||
exec_prefix = $(DESTDIR)#{CONFIG["exec_prefix"]}
|
"\nDESTDIR = " + destdir
|
||||||
libdir = $(DESTDIR)#{$libdir}#{target_prefix}
|
else
|
||||||
archdir = $(DESTDIR)#{$archdir}#{target_prefix}
|
""
|
||||||
sitelibdir = $(DESTDIR)#{$sitelibdir}#{target_prefix}
|
end
|
||||||
sitearchdir = $(DESTDIR)#{$sitearchdir}#{target_prefix}
|
}
|
||||||
|
prefix = $(DESTDIR)#{CONFIG["prefix"].sub(drive, '')}
|
||||||
|
exec_prefix = $(DESTDIR)#{CONFIG["exec_prefix"].sub(drive, '')}
|
||||||
|
libdir = $(DESTDIR)#{$libdir.sub(drive, '')}#{target_prefix}
|
||||||
|
archdir = $(DESTDIR)#{$archdir.sub(drive, '')}#{target_prefix}
|
||||||
|
sitelibdir = $(DESTDIR)#{$sitelibdir.sub(drive, '')}#{target_prefix}
|
||||||
|
sitearchdir = $(DESTDIR)#{$sitearchdir.sub(drive, '')}#{target_prefix}
|
||||||
|
|
||||||
#### End of system configuration section. ####
|
#### End of system configuration section. ####
|
||||||
|
|
||||||
|
@ -458,26 +485,36 @@ EOMF
|
||||||
install_rb(mfile, "$(sitelibdir)")
|
install_rb(mfile, "$(sitelibdir)")
|
||||||
mfile.printf "\n"
|
mfile.printf "\n"
|
||||||
|
|
||||||
if /mswin32/ =~ RUBY_PLATFORM
|
if /mswin32/ !~ RUBY_PLATFORM
|
||||||
mfile.print "
|
|
||||||
.c.obj:
|
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
|
||||||
|
|
||||||
{$(srcdir)}.c.obj:
|
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
|
||||||
|
|
||||||
"
|
|
||||||
else
|
|
||||||
mfile.print "
|
mfile.print "
|
||||||
.c.#{$OBJEXT}:
|
.c.#{$OBJEXT}:
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
|
||||||
|
"
|
||||||
|
elsif /nmake/i =~ $make
|
||||||
|
mfile.print "
|
||||||
|
{$(srcdir)}.c.#{$OBJEXT}:
|
||||||
|
$(CC) $(CFLAGS) -I$(<D) $(CPPFLAGS) -c $(<:/=\\)
|
||||||
|
|
||||||
|
.c.#{$OBJEXT}:
|
||||||
|
$(CC) $(CFLAGS) -I$(<D) $(CPPFLAGS) -c $(<:/=\\)
|
||||||
|
"
|
||||||
|
else
|
||||||
|
mfile.print "
|
||||||
|
.SUFFIXES: .#{$OBJEXT}
|
||||||
|
|
||||||
|
.c.#{$OBJEXT}:
|
||||||
|
$(CC) $(CFLAGS) $(CPPFLAGS) -c $(subst /,\\\\,$<)
|
||||||
"
|
"
|
||||||
end
|
end
|
||||||
|
|
||||||
if CONFIG["DLEXT"] != $OBJEXT
|
if CONFIG["DLEXT"] != $OBJEXT
|
||||||
mfile.print "$(DLLIB): $(OBJS)\n"
|
mfile.print "$(DLLIB): $(OBJS)\n"
|
||||||
if /mswin32/ =~ RUBY_PLATFORM
|
if /mswin32/ =~ RUBY_PLATFORM
|
||||||
mfile.print "\tset LIB=$(topdir:/=\\);$(LIB)\n"
|
if /nmake/i =~ $make
|
||||||
|
mfile.print "\tset LIB=$(LIBPATH:/=\\);$(LIB)\n"
|
||||||
|
else
|
||||||
|
mfile.print "\tenv LIB='$(subst /,\\\\,$(LIBPATH));$(LIB)' \\\n"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
mfile.print "\t$(LDSHARED) $(DLDFLAGS) -o $(DLLIB) $(OBJS) $(LIBS) $(LOCAL_LIBS)\n"
|
mfile.print "\t$(LDSHARED) $(DLDFLAGS) -o $(DLLIB) $(OBJS) $(LIBS) $(LOCAL_LIBS)\n"
|
||||||
elsif not File.exist?(target + ".c") and not File.exist?(target + ".cc")
|
elsif not File.exist?(target + ".c") and not File.exist?(target + ".cc")
|
||||||
|
@ -507,26 +544,26 @@ $libs = CONFIG["DLDLIBS"]
|
||||||
$local_flags = ""
|
$local_flags = ""
|
||||||
case RUBY_PLATFORM
|
case RUBY_PLATFORM
|
||||||
when /mswin32/
|
when /mswin32/
|
||||||
$local_flags = "$(RUBY_SO_NAME).lib -link /EXPORT:Init_$(TARGET)"
|
$local_flags = "-link /INCREMENTAL:no /EXPORT:Init_$(TARGET)"
|
||||||
end
|
end
|
||||||
$LOCAL_LIBS = ""
|
$LOCAL_LIBS = ""
|
||||||
$defs = []
|
$defs = []
|
||||||
|
|
||||||
|
$make = with_config("make-prog", ENV["MAKE"] || "make")
|
||||||
dir = with_config("opt-dir")
|
dir = with_config("opt-dir")
|
||||||
if dir
|
if dir
|
||||||
idir = "-I"+dir+"/include"
|
idir = "-I"+dir+"/include"
|
||||||
ldir = "-L"+dir+"/lib"
|
ldir = dir+"/lib"
|
||||||
end
|
end
|
||||||
unless idir
|
unless idir
|
||||||
dir = with_config("opt-include")
|
dir = with_config("opt-include")
|
||||||
idir = "-I"+dir if dir
|
idir = "-I"+dir if dir
|
||||||
end
|
end
|
||||||
unless ldir
|
unless ldir
|
||||||
dir = with_config("opt-lib")
|
ldir = with_config("opt-lib")
|
||||||
ldir = "-L"+dir if dir
|
|
||||||
end
|
end
|
||||||
|
|
||||||
$CFLAGS = idir || ""
|
$CFLAGS = with_config("cflags", "")
|
||||||
$LDFLAGS = ldir || ""
|
$CPPFLAGS = [with_config("cppflags", ""), idir].compact.join(" ")
|
||||||
|
$LDFLAGS = with_config("ldflags", "")
|
||||||
$hdrdir.gsub!('/', '\\') if RUBY_PLATFORM =~ /mswin32/
|
$LIBPATH = [ldir].compact
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# parsedate3.rb: Written by Tadayoshi Funaba 2000
|
# parsedate.rb: Written by Tadayoshi Funaba 2000
|
||||||
# $Id: parsedate3.rb,v 1.2 2000-04-01 12:16:56+09 tadf Exp $
|
# $Id: parsedate.rb,v 1.2 2000-04-01 12:16:56+09 tadf Exp $
|
||||||
|
|
||||||
module ParseDate
|
module ParseDate
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,10 @@ class Tracer
|
||||||
"call" => ">",
|
"call" => ">",
|
||||||
"return" => "<",
|
"return" => "<",
|
||||||
"class" => "C",
|
"class" => "C",
|
||||||
"end" => "E"}
|
"end" => "E",
|
||||||
|
"c-call" => ">",
|
||||||
|
"c-return" => "<",
|
||||||
|
}
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@threads = Hash.new
|
@threads = Hash.new
|
||||||
|
@ -59,8 +62,8 @@ class Tracer
|
||||||
off
|
off
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
set_trace_func proc{|event, file, line, id, binding, klass|
|
set_trace_func proc{|event, file, line, id, binding, klass, *rest|
|
||||||
trace_func event, file, line, id, binding
|
trace_func event, file, line, id, binding, klass
|
||||||
}
|
}
|
||||||
stdout.print "Trace on\n" if Tracer.verbose?
|
stdout.print "Trace on\n" if Tracer.verbose?
|
||||||
end
|
end
|
||||||
|
@ -85,7 +88,6 @@ class Tracer
|
||||||
end
|
end
|
||||||
|
|
||||||
unless list = LINES__[file]
|
unless list = LINES__[file]
|
||||||
# stdout.print file if $DEBUG
|
|
||||||
begin
|
begin
|
||||||
f = open(file)
|
f = open(file)
|
||||||
begin
|
begin
|
||||||
|
@ -112,21 +114,21 @@ class Tracer
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def trace_func(event, file, line, id, binding)
|
def trace_func(event, file, line, id, binding, klass)
|
||||||
return if file == MY_FILE_NAME
|
return if file == MY_FILE_NAME
|
||||||
#stdout.printf "Th: %s\n", Thread.current.inspect
|
|
||||||
|
|
||||||
for p in @filters
|
for p in @filters
|
||||||
return unless p.call event, file, line, id, binding
|
return unless p.call event, file, line, id, binding, klass
|
||||||
end
|
end
|
||||||
|
|
||||||
Thread.critical = true
|
Thread.critical = true
|
||||||
stdout.printf("#%d:%s:%d:%s: %s",
|
stdout.printf("#%d:%s:%d:%s:%s: %s",
|
||||||
get_thread_no,
|
get_thread_no,
|
||||||
file,
|
file,
|
||||||
line,
|
line,
|
||||||
EVENT_SYMBOL[event],
|
klass || '',
|
||||||
get_line(file, line))
|
EVENT_SYMBOL[event],
|
||||||
|
get_line(file, line))
|
||||||
Thread.critical = false
|
Thread.critical = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
48
parse.y
48
parse.y
|
@ -1022,7 +1022,7 @@ mrhs : arg
|
||||||
|
|
||||||
mrhs_basic : args ',' arg
|
mrhs_basic : args ',' arg
|
||||||
{
|
{
|
||||||
value_expr($1);
|
value_expr($3);
|
||||||
$$ = list_append($1, $3);
|
$$ = list_append($1, $3);
|
||||||
}
|
}
|
||||||
| args ',' tSTAR arg
|
| args ',' tSTAR arg
|
||||||
|
@ -3126,9 +3126,9 @@ yylex()
|
||||||
case '0': case '1': case '2': case '3': case '4':
|
case '0': case '1': case '2': case '3': case '4':
|
||||||
case '5': case '6': case '7': case '8': case '9':
|
case '5': case '6': case '7': case '8': case '9':
|
||||||
{
|
{
|
||||||
int is_float, seen_point, seen_e;
|
int is_float, seen_point, seen_e, seen_uc;
|
||||||
|
|
||||||
is_float = seen_point = seen_e = 0;
|
is_float = seen_point = seen_e = seen_uc = 0;
|
||||||
lex_state = EXPR_END;
|
lex_state = EXPR_END;
|
||||||
newtok();
|
newtok();
|
||||||
if (c == '-' || c == '+') {
|
if (c == '-' || c == '+') {
|
||||||
|
@ -3140,44 +3140,59 @@ yylex()
|
||||||
if (c == 'x' || c == 'X') {
|
if (c == 'x' || c == 'X') {
|
||||||
/* hexadecimal */
|
/* hexadecimal */
|
||||||
c = nextc();
|
c = nextc();
|
||||||
if (!ISXDIGIT(c)) {
|
|
||||||
yyerror("hexadecimal number without hex-digits");
|
|
||||||
}
|
|
||||||
do {
|
do {
|
||||||
if (c == '_') continue;
|
if (c == '_') {
|
||||||
|
seen_uc = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!ISXDIGIT(c)) break;
|
if (!ISXDIGIT(c)) break;
|
||||||
|
seen_uc = 0;
|
||||||
tokadd(c);
|
tokadd(c);
|
||||||
} while (c = nextc());
|
} while (c = nextc());
|
||||||
pushback(c);
|
pushback(c);
|
||||||
tokfix();
|
tokfix();
|
||||||
|
if (toklen() == 0) {
|
||||||
|
yyerror("hexadecimal number without hex-digits");
|
||||||
|
}
|
||||||
|
else if (seen_uc) goto trailing_uc;
|
||||||
yylval.val = rb_cstr2inum(tok(), 16);
|
yylval.val = rb_cstr2inum(tok(), 16);
|
||||||
return tINTEGER;
|
return tINTEGER;
|
||||||
}
|
}
|
||||||
if (c == 'b' || c == 'B') {
|
if (c == 'b' || c == 'B') {
|
||||||
/* binary */
|
/* binary */
|
||||||
c = nextc();
|
c = nextc();
|
||||||
if (c != '0' && c != '1') {
|
|
||||||
yyerror("numeric literal without digits");
|
|
||||||
}
|
|
||||||
do {
|
do {
|
||||||
if (c == '_') continue;
|
if (c == '_') {
|
||||||
|
seen_uc = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (c != '0'&& c != '1') break;
|
if (c != '0'&& c != '1') break;
|
||||||
|
seen_uc = 0;
|
||||||
tokadd(c);
|
tokadd(c);
|
||||||
} while (c = nextc());
|
} while (c = nextc());
|
||||||
pushback(c);
|
pushback(c);
|
||||||
tokfix();
|
tokfix();
|
||||||
|
if (toklen() == 0) {
|
||||||
|
yyerror("numeric literal without digits");
|
||||||
|
}
|
||||||
|
else if (seen_uc) goto trailing_uc;
|
||||||
yylval.val = rb_cstr2inum(tok(), 2);
|
yylval.val = rb_cstr2inum(tok(), 2);
|
||||||
return tINTEGER;
|
return tINTEGER;
|
||||||
}
|
}
|
||||||
if (c >= '0' && c <= '7' || c == '_') {
|
if (c >= '0' && c <= '7' || c == '_') {
|
||||||
/* octal */
|
/* octal */
|
||||||
do {
|
do {
|
||||||
if (c == '_') continue;
|
if (c == '_') {
|
||||||
|
seen_uc = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (c < '0' || c > '7') break;
|
if (c < '0' || c > '7') break;
|
||||||
|
seen_uc = 0;
|
||||||
tokadd(c);
|
tokadd(c);
|
||||||
} while (c = nextc());
|
} while (c = nextc());
|
||||||
pushback(c);
|
pushback(c);
|
||||||
tokfix();
|
tokfix();
|
||||||
|
if (seen_uc) goto trailing_uc;
|
||||||
yylval.val = rb_cstr2inum(tok(), 8);
|
yylval.val = rb_cstr2inum(tok(), 8);
|
||||||
return tINTEGER;
|
return tINTEGER;
|
||||||
}
|
}
|
||||||
|
@ -3198,6 +3213,7 @@ yylex()
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case '0': case '1': case '2': case '3': case '4':
|
case '0': case '1': case '2': case '3': case '4':
|
||||||
case '5': case '6': case '7': case '8': case '9':
|
case '5': case '6': case '7': case '8': case '9':
|
||||||
|
seen_uc = 0;
|
||||||
tokadd(c);
|
tokadd(c);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -3217,6 +3233,7 @@ yylex()
|
||||||
tokadd(c);
|
tokadd(c);
|
||||||
is_float++;
|
is_float++;
|
||||||
seen_point++;
|
seen_point++;
|
||||||
|
seen_uc = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'e':
|
case 'e':
|
||||||
|
@ -3233,7 +3250,8 @@ yylex()
|
||||||
continue;
|
continue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '_': /* `_' in decimal just ignored */
|
case '_': /* `_' in number just ignored */
|
||||||
|
seen_uc = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -3245,6 +3263,10 @@ yylex()
|
||||||
decode_num:
|
decode_num:
|
||||||
pushback(c);
|
pushback(c);
|
||||||
tokfix();
|
tokfix();
|
||||||
|
if (seen_uc) {
|
||||||
|
trailing_uc:
|
||||||
|
yyerror("trailing `_' in number");
|
||||||
|
}
|
||||||
if (is_float) {
|
if (is_float) {
|
||||||
double d = strtod(tok(), 0);
|
double d = strtod(tok(), 0);
|
||||||
if (errno == ERANGE) {
|
if (errno == ERANGE) {
|
||||||
|
|
4
time.c
4
time.c
|
@ -696,6 +696,10 @@ time_minus(time1, time2)
|
||||||
sec = tobj->tv.tv_sec - sec;
|
sec = tobj->tv.tv_sec - sec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (usec >= 1000000) { /* usec overflow */
|
||||||
|
sec++;
|
||||||
|
usec -= 1000000;
|
||||||
|
}
|
||||||
if (usec < 0) { /* usec underflow */
|
if (usec < 0) { /* usec underflow */
|
||||||
sec--;
|
sec--;
|
||||||
usec += 1000000;
|
usec += 1000000;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#define RUBY_VERSION "1.6.2"
|
#define RUBY_VERSION "1.6.2"
|
||||||
#define RUBY_RELEASE_DATE "2000-12-18"
|
#define RUBY_RELEASE_DATE "2000-12-22"
|
||||||
#define RUBY_VERSION_CODE 162
|
#define RUBY_VERSION_CODE 162
|
||||||
#define RUBY_RELEASE_CODE 20001218
|
#define RUBY_RELEASE_CODE 20001222
|
||||||
|
|
|
@ -21,6 +21,7 @@ RUBY_SO_NAME = rubymw
|
||||||
###############
|
###############
|
||||||
|
|
||||||
VPATH = $(srcdir):$(srcdir)/missing
|
VPATH = $(srcdir):$(srcdir)/missing
|
||||||
|
.SUFFIXES: .y
|
||||||
|
|
||||||
CC = cl
|
CC = cl
|
||||||
YACC = byacc
|
YACC = byacc
|
||||||
|
@ -186,22 +187,25 @@ $(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(LIBRUBY_SO).rc: rbconfig.rb
|
||||||
#config.status: $(srcdir)/configure
|
#config.status: $(srcdir)/configure
|
||||||
# $(SHELL) ./config.status --recheck
|
# $(SHELL) ./config.status --recheck
|
||||||
|
|
||||||
|
{$(srcdir)/missing}.c.obj:
|
||||||
|
$(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c $(<:/=\)
|
||||||
|
{$(srcdir)/win32}.c.obj:
|
||||||
|
$(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c $(<:/=\)
|
||||||
|
{$(srcdir)}.c.obj:
|
||||||
|
$(CC) $(CFLAGS) -I. -I$(<D) $(CPPFLAGS) -c $(<:/=\)
|
||||||
.c.obj:
|
.c.obj:
|
||||||
|
$(CC) $(CFLAGS) -I. $(CPPFLAGS) -c $(<:/=\)
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
|
$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
|
||||||
{$(srcdir)}.c{}.obj:
|
|
||||||
$(CC) -I. -I$(<D) $(CFLAGS) $(CPPFLAGS) -c $(<:/=\)
|
|
||||||
{$(srcdir)/missing}.c{}.obj:
|
|
||||||
$(CC) -I. -I$(<D) $(CFLAGS) $(CPPFLAGS) -c $(<:/=\)
|
|
||||||
{$(srcdir)/win32}.c{}.obj:
|
|
||||||
$(CC) -I. -I$(<D) $(CFLAGS) $(CPPFLAGS) -c $(<:/=\)
|
|
||||||
|
|
||||||
.rc.res:
|
.rc.res:
|
||||||
$(RC) -I. -I$(<D) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $<
|
$(RC) -I. -I$(<D) -I$(srcdir)/win32 $(RFLAGS) -fo$@ $<
|
||||||
|
|
||||||
parse.c: $(srcdir)/parse.y
|
{$(srcdir)}.y.c:
|
||||||
$(YACC) $(YFLAGS) $(srcdir)/parse.y
|
$(YACC) $(YFLAGS) $(<:\=/)
|
||||||
sed -e "s!^extern char \*getenv();!/* & */!" y.tab.c > parse.c
|
sed -e "s!^extern char \*getenv();!/* & */!;s/^\(#.*\)y\.tab/\1parse/" y.tab.c > $@
|
||||||
@rm y.tab.c
|
@del y.tab.c
|
||||||
|
|
||||||
|
{$(srcdir)}parse.c: parse.y
|
||||||
|
|
||||||
alloca.obj: $(srcdir)/missing/alloca.c
|
alloca.obj: $(srcdir)/missing/alloca.c
|
||||||
crypt.obj: $(srcdir)/missing/crypt.c
|
crypt.obj: $(srcdir)/missing/crypt.c
|
||||||
|
@ -236,7 +240,7 @@ win32.obj: $(srcdir)/win32/win32.c
|
||||||
# Prevent GNU make v3 from overflowing arg limit on SysV.
|
# Prevent GNU make v3 from overflowing arg limit on SysV.
|
||||||
.NOEXPORT:
|
.NOEXPORT:
|
||||||
###
|
###
|
||||||
parse.obj: $(srcdir)/parse.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/env.h $(srcdir)/node.h $(srcdir)/st.h $(srcdir)/regex.h $(srcdir)/util.h $(srcdir)/lex.c
|
parse.obj: {$(srcdir)}parse.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h $(srcdir)/env.h $(srcdir)/node.h $(srcdir)/st.h $(srcdir)/regex.h $(srcdir)/util.h $(srcdir)/lex.c
|
||||||
###
|
###
|
||||||
array.obj: $(srcdir)/array.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h
|
array.obj: $(srcdir)/array.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h
|
||||||
bignum.obj: $(srcdir)/bignum.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h
|
bignum.obj: $(srcdir)/bignum.c $(srcdir)/ruby.h config.h $(srcdir)/defines.h $(srcdir)/intern.h
|
||||||
|
|
|
@ -57,7 +57,7 @@ s%@LIBRUBY_A@%lib$(RUBY_INSTALL_NAME).lib%g
|
||||||
s%@LIBRUBY_SO@%%g
|
s%@LIBRUBY_SO@%%g
|
||||||
s%@LIBRUBY_ALIASES@%%g
|
s%@LIBRUBY_ALIASES@%%g
|
||||||
s%@LIBRUBY@%$(RUBY_SO_NAME).lib%g
|
s%@LIBRUBY@%$(RUBY_SO_NAME).lib%g
|
||||||
s%@LIBRUBYARG@%$(topdir)/$(RUBY_SO_NAME).lib%g
|
s%@LIBRUBYARG@%$(RUBY_SO_NAME).lib%g
|
||||||
s%@SOLIBS@%%g
|
s%@SOLIBS@%%g
|
||||||
s%@DLDLIBS@%%g
|
s%@DLDLIBS@%%g
|
||||||
s%@arch@%i586-mswin32%g
|
s%@arch@%i586-mswin32%g
|
||||||
|
|
Загрузка…
Ссылка в новой задаче