2000-06-05

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-06-05 08:46:59 +00:00
parent 76d09411e9
commit ecd1aab526
9 changed files with 94 additions and 24 deletions

View File

@ -14,10 +14,32 @@ Sun Jun 4 02:01:10 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
* lib/mkmf.rb: do not need to add -L$(topdir) in --enable-shared case. * lib/mkmf.rb: do not need to add -L$(topdir) in --enable-shared case.
Sat Jun 3 13:50:06 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* parse.y (rb_id2name): should support constant attrset
identifiers.
* bignum.c (rb_big_eq): Bignum#== should not raise exception.
Fri Jun 2 11:24:48 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* io.c (rb_io_popen): open with a block returns the value from the
block. old behavior was back.
Fri Jun 2 00:42:31 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* eval.c (rb_thread_cleanup): should clear priority for thread
termination.
Thu Jun 1 00:59:15 2000 Yukihiro Matsumoto <matz@netlab.co.jp> Thu Jun 1 00:59:15 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* eval.c (rb_yield_0): convert Qundef to []. * eval.c (rb_yield_0): convert Qundef to [].
Wed May 31 20:45:59 2000 Dave Thomas <Dave@Thomases.com>
* string.c (rb_str_slice_bang): wrong argument number.
Wed May 31 12:37:04 2000 Yukihiro Matsumoto <matz@netlab.co.jp> Wed May 31 12:37:04 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
* eval.c (rb_exec_end_proc): print error message from END procs. * eval.c (rb_exec_end_proc): print error message from END procs.
@ -37,11 +59,6 @@ Wed May 31 01:54:21 2000 Yukihiro Matsumoto <matz@netlab.co.jp>
Tue May 30 23:33:41 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp> Tue May 30 23:33:41 2000 Katsuyuki Komatsu <komatsu@sarion.co.jp>
* ext/extmk.rb.in (have_library, have_func): remove unnecessary
try_link() call from the mswin32 platform branch.
* lib/mkmf.rb (have_library, have_func): ditto.
* lib/mkmf.rb (create_makefile): add $(TARGET).ilk and *.pdb * lib/mkmf.rb (create_makefile): add $(TARGET).ilk and *.pdb
to cleanup files for mswin32. to cleanup files for mswin32.

View File

@ -520,6 +520,10 @@ rb_big_cmp(x, y)
case T_BIGNUM: case T_BIGNUM:
break; break;
case T_FLOAT:
y = rb_dbl2big(RFLOAT(y)->value);
break;
default: default:
return rb_num_coerce_bin(x, y); return rb_num_coerce_bin(x, y);
} }
@ -542,8 +546,22 @@ static VALUE
rb_big_eq(x, y) rb_big_eq(x, y)
VALUE x, y; VALUE x, y;
{ {
if (rb_big_cmp(x, y) == INT2FIX(0)) return Qtrue; switch (TYPE(y)) {
return Qfalse; case T_FIXNUM:
y = rb_int2big(FIX2LONG(y));
break;
case T_BIGNUM:
break;
case T_FLOAT:
y = rb_dbl2big(RFLOAT(y)->value);
break;
default:
return Qfalse;
}
if (RBIGNUM(x)->sign != RBIGNUM(y)->sign) return Qfalse;
if (RBIGNUM(x)->len != RBIGNUM(y)->len) return Qfalse;
if (memcmp(BDIGITS(x),BDIGITS(y),RBIGNUM(y)->len) != 0) return Qfalse;
return Qtrue;
} }
static VALUE static VALUE

View File

@ -425,6 +425,7 @@ if test "$with_dln_a_out" != yes; then
netbsd*) CCDLFLAGS=-fpic netbsd*) CCDLFLAGS=-fpic
case "$target_cpu" in case "$target_cpu" in
mips*) CCDLFLAGS=-fPIC ;; mips*) CCDLFLAGS=-fPIC ;;
sparc) CCDLFLAGS=-fPIC ;;
*) ;; *) ;;
esac ;; esac ;;
*) CCDLFLAGS=-fPIC;; *) CCDLFLAGS=-fPIC;;
@ -432,7 +433,7 @@ if test "$with_dln_a_out" != yes; then
else else
case "$target_os" in case "$target_os" in
hpux*) CCDLFLAGS='+z';; hpux*) CCDLFLAGS='+z';;
solaris*|irix*) CCDLFLAGS='-K PIC' ;; solaris*|irix*) CCDLFLAGS='-KPIC' ;;
sunos*) CCDLFLAGS='-PIC' ;; sunos*) CCDLFLAGS='-PIC' ;;
esix*|uxpds*) CCDLFLAGS='-KPIC' ;; esix*|uxpds*) CCDLFLAGS='-KPIC' ;;
*) CCDLFLAGS='' ;; *) CCDLFLAGS='' ;;
@ -453,7 +454,7 @@ if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=yes;; rb_cv_dlopen=yes;;
sunos*) LDSHARED='ld -assert nodefinitions' sunos*) LDSHARED='ld -assert nodefinitions'
rb_cv_dlopen=yes;; rb_cv_dlopen=yes;;
irix*) LDSHARED='ld -ignore_unresolved' irix*) LDSHARED='ld -shared'
rb_cv_dlopen=yes;; rb_cv_dlopen=yes;;
sysv4*) LDSHARED='ld -G' sysv4*) LDSHARED='ld -G'
rb_cv_dlopen=yes;; rb_cv_dlopen=yes;;

4
eval.c
View File

@ -6880,7 +6880,7 @@ rb_thread_schedule()
} }
FOREACH_THREAD_FROM(curr, th) { FOREACH_THREAD_FROM(curr, th) {
if (!next && (th->status <= THREAD_RUNNABLE)) { if (th->status <= THREAD_RUNNABLE) {
if (!next || next->priority < th->priority) if (!next || next->priority < th->priority)
next = th; next = th;
} }
@ -7283,6 +7283,7 @@ rb_thread_priority_set(thread, prio)
th = rb_thread_check(thread); th = rb_thread_check(thread);
th->priority = NUM2INT(prio); th->priority = NUM2INT(prio);
rb_thread_schedule();
return thread; return thread;
} }
@ -7643,6 +7644,7 @@ rb_thread_cleanup()
if (th != curr_thread && th->status != THREAD_KILLED) { if (th != curr_thread && th->status != THREAD_KILLED) {
rb_thread_ready(th); rb_thread_ready(th);
th->gid = 0; th->gid = 0;
th->priority = 0;
th->status = THREAD_TO_KILL; th->status = THREAD_TO_KILL;
} }
} }

View File

@ -174,8 +174,16 @@ def have_library(lib, func="main")
#include <windows.h> #include <windows.h>
#include <winsock.h> #include <winsock.h>
int main() { return 0; } int main() { return 0; }
int t() { #{func}(); return 0; }
SRC
unless r
r = try_link(<<"SRC", libs)
#include <windows.h>
#include <winsock.h>
int main() { return 0; }
int t() { void ((*p)()); p = (void ((*)()))#{func}; return 0; } int t() { void ((*p)()); p = (void ((*)()))#{func}; return 0; }
SRC SRC
end
else else
r = try_link(<<"SRC", libs) r = try_link(<<"SRC", libs)
int main() { return 0; } int main() { return 0; }
@ -218,8 +226,16 @@ def have_func(func)
#include <windows.h> #include <windows.h>
#include <winsock.h> #include <winsock.h>
int main() { return 0; } int main() { return 0; }
int t() { #{func}(); return 0; }
SRC
unless r
r = try_link(<<"SRC", libs)
#include <windows.h>
#include <winsock.h>
int main() { return 0; }
int t() { void ((*p)()); p = (void ((*)()))#{func}; return 0; } int t() { void ((*p)()); p = (void ((*)()))#{func}; return 0; }
SRC SRC
end
else else
r = try_link(<<"SRC", libs) r = try_link(<<"SRC", libs)
int main() { return 0; } int main() { return 0; }

6
io.c
View File

@ -1613,8 +1613,7 @@ rb_io_popen(str, argc, argv, klass)
} }
RBASIC(port)->klass = klass; RBASIC(port)->klass = klass;
if (rb_block_given_p()) { if (rb_block_given_p()) {
rb_ensure(rb_yield, port, rb_io_close, port); return rb_ensure(rb_yield, port, rb_io_close, port);
return Qnil;
} }
return port; return port;
} }
@ -1665,8 +1664,7 @@ rb_file_s_open(argc, argv, klass)
} }
if (rb_block_given_p()) { if (rb_block_given_p()) {
rb_ensure(rb_yield, file, rb_io_close, file); return rb_ensure(rb_yield, file, rb_io_close, file);
return Qnil;
} }
return file; return file;

View File

@ -159,8 +159,16 @@ def have_library(lib, func="main")
#include <windows.h> #include <windows.h>
#include <winsock.h> #include <winsock.h>
int main() { return 0; } int main() { return 0; }
int t() { #{func}(); return 0; }
SRC
unless r
r = try_link(<<"SRC", libs)
#include <windows.h>
#include <winsock.h>
int main() { return 0; }
int t() { void ((*p)()); p = (void ((*)()))#{func}; return 0; } int t() { void ((*p)()); p = (void ((*)()))#{func}; return 0; }
SRC SRC
end
else else
r = try_link(<<"SRC", libs) r = try_link(<<"SRC", libs)
int main() { return 0; } int main() { return 0; }
@ -213,8 +221,16 @@ def have_func(func)
#include <windows.h> #include <windows.h>
#include <winsock.h> #include <winsock.h>
int main() { return 0; } int main() { return 0; }
int t() { #{func}(); return 0; }
SRC
unless r
r = try_link(<<"SRC", libs)
#include <windows.h>
#include <winsock.h>
int main() { return 0; }
int t() { void ((*p)()); p = (void ((*)()))#{func}; return 0; } int t() { void ((*p)()); p = (void ((*)()))#{func}; return 0; }
SRC SRC
end
else else
r = try_link(<<"SRC", libs) r = try_link(<<"SRC", libs)
int main() { return 0; } int main() { return 0; }

18
parse.y
View File

@ -4737,20 +4737,22 @@ rb_id2name(id)
return name; return name;
if (is_attrset_id(id)) { if (is_attrset_id(id)) {
char *res; ID id2 = (id & ~ID_SCOPE_MASK) | ID_LOCAL;
ID id2;
id2 = (id & ~ID_SCOPE_MASK) | ID_LOCAL; again:
res = rb_id2name(id2); name = rb_id2name(id2);
if (name) {
char *buf = ALLOCA_N(char, strlen(name)+2);
if (res) { strcpy(buf, name);
char *buf = ALLOCA_N(char, strlen(res)+2);
strcpy(buf, res);
strcat(buf, "="); strcat(buf, "=");
rb_intern(buf); rb_intern(buf);
return rb_id2name(id); return rb_id2name(id);
} }
if (is_local_id(id2)) {
id2 = (id & ~ID_SCOPE_MASK) | ID_CONST;
goto again;
}
} }
return 0; return 0;
} }

View File

@ -1053,8 +1053,8 @@ rb_str_slice_bang(argc, argv, str)
buf[i] = argv[i]; buf[i] = argv[i];
} }
buf[i] = rb_str_new(0,0); buf[i] = rb_str_new(0,0);
result = rb_str_aref_m(2, buf, str); result = rb_str_aref_m(argc, buf, str);
rb_str_aset_m(3, buf, str); rb_str_aset_m(argc+1, buf, str);
return result; return result;
} }