From bcec81835dc263b933f2629aa5329f6c943da60d Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 9 Feb 1999 03:29:23 +0000 Subject: 990209 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 27 +++++++++++++++++++++++++++ array.c | 2 +- bignum.c | 2 +- configure | 51 +++++++++++++++++++++++++++++---------------------- configure.in | 15 +++++++++++---- dln.c | 2 +- error.c | 2 +- eval.c | 2 +- ext/extmk.rb.in | 2 +- hash.c | 2 +- instruby.rb | 30 ++++++++++++++---------------- missing/vsnprintf.c | 31 ------------------------------- parse.y | 1 + version.h | 4 ++-- 14 files changed, 91 insertions(+), 82 deletions(-) diff --git a/ChangeLog b/ChangeLog index 09d6b22a2f..7f50ea0600 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +Mon Feb 8 23:53:58 1999 SHIROYAMA Takayuki + + * dln.c (FUNCNAME_PATTERN): FreeBSD for alpha/mips + +Mon Feb 8 17:07:37 1999 Koji Arai + + * error.c (rb_sys_fail): need to allocate enough size buffer. + +Fri Feb 5 00:01:50 1999 Yukihiro Matsumoto + + * parse.y (terms): needed to clear heredoc_end. + +Sat Jan 30 01:51:16 1999 Yukihiro Matsumoto + + * array.c (rb_ary_delete_if): RTEST() missing. + + * hash.c (delete_if_i): ditto. + +Wed Jan 27 17:50:02 1999 Kazuhiro HIWADA + + * bignum.c (dbl2big): raised error if double is too big to cast + into long. check added. + +Wed Jan 27 15:45:04 1999 Yukihiro Matsumoto + + * eval.c (rb_alias): was corrupting body. + Thu Jan 21 18:04:05 1999 Yukihiro Matsumoto * version 1.2.2 (stable) released. diff --git a/array.c b/array.c index 050de2d553..ca24daa16c 100644 --- a/array.c +++ b/array.c @@ -864,7 +864,7 @@ ary_delete_if(ary) ary_modify(ary); for (i1 = i2 = 0; i1 < RARRAY(ary)->len; i1++) { - if (rb_yield(RARRAY(ary)->ptr[i1])) continue; + if (RTEST(rb_yield(RARRAY(ary)->ptr[i1]))) continue; if (i1 != i2) { RARRAY(ary)->ptr[i2] = RARRAY(ary)->ptr[i1]; } diff --git a/bignum.c b/bignum.c index f553b080bc..170055d912 100644 --- a/bignum.c +++ b/bignum.c @@ -395,7 +395,7 @@ dbl2big(d) VALUE z; double u = (d < 0)?-d:d; - while (0 != (long)u) { + while (!FIXABLE(u) || 0 != (long)u) { u /= (double)(BIGRAD); i++; } diff --git a/configure b/configure index 4b887bb2a6..f078dc0052 100644 --- a/configure +++ b/configure @@ -3472,12 +3472,19 @@ echo "configure:3439: checking whether OS depend dynamic link works" >&5 rb_cv_dlopen=yes ;; linux*) LDSHARED="gcc -shared" rb_cv_dlopen=yes ;; - freebsd3*) LDSHARED="ld -Bshareable" - LDFLAGS="-rdynamic" - rb_cv_dlopen=yes ;; - freebsd*) LDSHARED="ld -Bshareable" + freebsd*) LDSHARED="gcc -shared" + if test -x /usr/bin/objformat -a \ + `/usr/bin/objformat` = "elf" ; then + LDFLAGS="-rdynamic" + fi rb_cv_dlopen=yes ;; netbsd*) LDSHARED="ld -Bshareable" + case "$host_cpu" in + alpha|mips) + LDFLAGS="-export-dynamic" ;; + *) + ;; + esac rb_cv_dlopen=yes ;; openbsd*) LDSHARED="ld -Bforcearchive -Bshareable" CCDLFLAGS=-fPIC @@ -3519,13 +3526,13 @@ dln_a_out_works=no if test "$ac_cv_header_a_out_h" = yes; then if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then echo $ac_n "checking whether matz's dln works""... $ac_c" 1>&6 -echo "configure:3523: checking whether matz's dln works" >&5 +echo "configure:3530: checking whether matz's dln works" >&5 cat confdefs.h > config.h if eval "test \"`echo '$''{'rb_cv_dln_a_out'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3546: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_dln_a_out=yes else @@ -3637,7 +3644,7 @@ fi case "$host_os" in human*) echo $ac_n "checking for _harderr in -lsignal""... $ac_c" 1>&6 -echo "configure:3641: checking for _harderr in -lsignal" >&5 +echo "configure:3648: checking for _harderr in -lsignal" >&5 ac_lib_var=`echo signal'_'_harderr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3645,7 +3652,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsignal $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3684,7 +3691,7 @@ else fi echo $ac_n "checking for hmemset in -lhmem""... $ac_c" 1>&6 -echo "configure:3688: checking for hmemset in -lhmem" >&5 +echo "configure:3695: checking for hmemset in -lhmem" >&5 ac_lib_var=`echo hmem'_'hmemset | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3692,7 +3699,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lhmem $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3733,12 +3740,12 @@ fi for ac_func in select do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3737: checking for $ac_func" >&5 +echo "configure:3744: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3786,7 +3793,7 @@ fi done echo $ac_n "checking whether PD libc _dtos18 fail to convert big number""... $ac_c" 1>&6 -echo "configure:3790: checking whether PD libc _dtos18 fail to convert big number" >&5 +echo "configure:3797: checking whether PD libc _dtos18 fail to convert big number" >&5 if eval "test \"`echo '$''{'rb_cv_missing__dtos18'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3794,7 +3801,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -3806,7 +3813,7 @@ main () } EOF -if { (eval echo configure:3810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then rb_cv_missing__dtos18=yes else @@ -3828,7 +3835,7 @@ EOF fi echo $ac_n "checking whether PD libc fconvert fail to round""... $ac_c" 1>&6 -echo "configure:3832: checking whether PD libc fconvert fail to round" >&5 +echo "configure:3839: checking whether PD libc fconvert fail to round" >&5 if eval "test \"`echo '$''{'rb_cv_missing_fconvert'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3836,7 +3843,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < @@ -3849,7 +3856,7 @@ main () } EOF -if { (eval echo configure:3853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then rb_cv_missing_fconvert=yes else diff --git a/configure.in b/configure.in index 8d993eed4d..1c3874c204 100644 --- a/configure.in +++ b/configure.in @@ -375,12 +375,19 @@ if test "$with_dln_a_out" != yes; then rb_cv_dlopen=yes ;; linux*) LDSHARED="gcc -shared" rb_cv_dlopen=yes ;; - freebsd3*) LDSHARED="ld -Bshareable" - LDFLAGS="-rdynamic" - rb_cv_dlopen=yes ;; - freebsd*) LDSHARED="ld -Bshareable" + freebsd*) LDSHARED="gcc -shared" + if test -x /usr/bin/objformat -a \ + `/usr/bin/objformat` = "elf" ; then + LDFLAGS="-rdynamic" + fi rb_cv_dlopen=yes ;; netbsd*) LDSHARED="ld -Bshareable" + case "$host_cpu" in + alpha|mips) + LDFLAGS="-export-dynamic" ;; + *) + ;; + esac rb_cv_dlopen=yes ;; openbsd*) LDSHARED="ld -Bforcearchive -Bshareable" CCDLFLAGS=-fPIC diff --git a/dln.c b/dln.c index d9c129532e..ff671bf737 100644 --- a/dln.c +++ b/dln.c @@ -78,7 +78,7 @@ int eaccess(); #endif #ifndef FUNCNAME_PATTERN -# if defined(__hp9000s300) || defined(__NetBSD__) || defined(__BORLANDC__) || (defined(__FreeBSD__) && __FreeBSD__ < 3) || defined(NeXT) || defined(__WATCOMC__) +# if defined(__hp9000s300) || ( defined(__NetBSD__) && (!defined(__alpha__) && !defined(__mips__))) || defined(__BORLANDC__) || (defined(__FreeBSD__) && __FreeBSD__ < 3) || defined(NeXT) || defined(__WATCOMC__) # define FUNCNAME_PATTERN "_Init_%.200s" # else # define FUNCNAME_PATTERN "Init_%.200s" diff --git a/error.c b/error.c index 564358c83b..844ff76f61 100644 --- a/error.c +++ b/error.c @@ -702,7 +702,7 @@ rb_sys_fail(mesg) err = strerror(errno); if (mesg) { - buf = ALLOCA_N(char, strlen(err)+strlen(mesg)+1); + buf = ALLOCA_N(char, strlen(err)+strlen(mesg)+4); sprintf(buf, "%s - %s", err, mesg); } else { diff --git a/eval.c b/eval.c index a8e8329d7a..5df59dc92b 100644 --- a/eval.c +++ b/eval.c @@ -203,9 +203,9 @@ rb_alias(klass, name, def) } body = orig->nd_body; if (nd_type(body) == NODE_FBODY) { /* was alias */ - body = body->nd_head; def = body->nd_mid; origin = body->nd_orig; + body = body->nd_head; } st_insert(RCLASS(klass)->m_tbl, name, diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in index fdc90b5abe..bb0e042371 100644 --- a/ext/extmk.rb.in +++ b/ext/extmk.rb.in @@ -280,7 +280,7 @@ CC = @CC@ prefix = @prefix@ CFLAGS = %s -I#{$topdir} -I#{$top_srcdir} -I@includedir@ %s #$CFLAGS %s -DLDFLAGS = #$DLDFLAGS @LDFLAGS@ #$LDFLAGS +DLDFLAGS = #$DLDFLAGS #$LDFLAGS LDSHARED = @LDSHARED@ ", if $static then "" else "@CCDLFLAGS@" end, CFLAGS, $defs.join(" ") diff --git a/hash.c b/hash.c index 3f1ce8cb84..ec2b28ce15 100644 --- a/hash.c +++ b/hash.c @@ -439,7 +439,7 @@ delete_if_i(key, value) VALUE key, value; { if (key == Qnil) return ST_CONTINUE; - if (rb_yield(assoc_new(key, value))) + if (RTEST(rb_yield(assoc_new(key, value)))) return ST_DELETE; return ST_CONTINUE; } diff --git a/instruby.rb b/instruby.rb index a08fcb8d33..c02f48cc4e 100644 --- a/instruby.rb +++ b/instruby.rb @@ -3,8 +3,6 @@ require "rbconfig.rb" include Config -destdir = ARGV[0] || '' - $:.unshift CONFIG["srcdir"]+"/lib" require "ftools" @@ -22,34 +20,34 @@ archdir = pkglibdir + "/" + CONFIG["arch"] mandir = CONFIG["mandir"] + "/man1" wdir = Dir.getwd -File.makedirs "#{destdir}#{bindir}", TRUE +File.makedirs bindir, TRUE File.install "ruby#{binsuffix}", - "#{destdir}#{bindir}/#{ruby_install_name}#{binsuffix}", 0755, TRUE + "#{bindir}/#{ruby_install_name}#{binsuffix}", 0755, TRUE for dll in Dir['*.dll'] - File.install dll, "#{destdir}#{bindir}/#{dll}", 0755, TRUE + File.install dll, "#{bindir}/#{dll}", 0755, TRUE end -File.makedirs "#{destdir}#{libdir}", TRUE +File.makedirs libdir, TRUE for lib in ["libruby.so", "libruby.so.LIB"] if File.exist? lib - File.install lib, "#{destdir}#{libdir}", 0644, TRUE + File.install lib, "#{libdir}", 0644, TRUE end end -File.makedirs "#{destdir}#{pkglibdir}", TRUE -File.makedirs "#{destdir}#{archdir}", TRUE +File.makedirs pkglibdir, TRUE +File.makedirs archdir, TRUE Dir.chdir "ext" -system "../miniruby#{binsuffix} extmk.rb install #{destdir}" +system "../miniruby#{binsuffix} extmk.rb install" Dir.chdir CONFIG["srcdir"] IO.foreach 'MANIFEST' do |$_| $_.chop! if /^lib/ - File.install $_, "#{destdir}#{pkglibdir}", 0644, TRUE + File.install $_, "#{pkglibdir}", 0644, TRUE elsif /^[a-z]+\.h$/ - File.install $_, "#{destdir}#{archdir}", 0644, TRUE + File.install $_, "#{archdir}", 0644, TRUE end end -File.makedirs "#{destdir}#{mandir}", TRUE -File.install "ruby.1", "#{destdir}#{mandir}", 0644, TRUE +File.makedirs mandir, TRUE +File.install "ruby.1", "#{mandir}", 0644, TRUE Dir.chdir wdir -File.install "config.h", "#{destdir}#{archdir}", 0644, TRUE -File.install "rbconfig.rb", "#{destdir}#{archdir}", 0644, TRUE +File.install "config.h", "#{archdir}", 0644, TRUE +File.install "rbconfig.rb", "#{archdir}", 0644, TRUE # vi:set sw=2: diff --git a/missing/vsnprintf.c b/missing/vsnprintf.c index 39c34890bd..22feac5f15 100644 --- a/missing/vsnprintf.c +++ b/missing/vsnprintf.c @@ -179,32 +179,6 @@ typedef struct __sFILE { #define EOF (-1) -/* - * The __sfoo macros are here so that we can - * define function versions in the C library. - */ -#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++)) -#if defined(__GNUC__) && defined(__STDC__) -static __inline int __sputc(int _c, FILE *_p) { - if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) - return (*_p->_p++ = _c); - else - return (__swbuf(_c, _p)); -} -#else -/* - * This has been tuned to generate reasonable code on the vax using pcc. - */ -#define __sputc(c, p) \ - (--(p)->_w < 0 ? \ - (p)->_w >= (p)->_lbfsize ? \ - (*(p)->_p = (c)), *(p)->_p != '\n' ? \ - (int)*(p)->_p++ : \ - __swbuf('\n', p) : \ - __swbuf((int)(c), p) : \ - (*(p)->_p = (c), (int)*(p)->_p++)) -#endif - #define __sfeof(p) (((p)->_flags & __SEOF) != 0) #define __sferror(p) (((p)->_flags & __SERR) != 0) #define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) @@ -218,11 +192,6 @@ static __inline int __sputc(int _c, FILE *_p) { #define fileno(p) __sfileno(p) #endif -#ifndef lint -#define getc(fp) __sgetc(fp) -#define putc(x, fp) __sputc(x, fp) -#endif /* lint */ - #if defined(__hpux) && !defined(__GNUC__) #include diff --git a/parse.y b/parse.y index 8a15186c8a..5d5ade2eb5 100644 --- a/parse.y +++ b/parse.y @@ -1655,6 +1655,7 @@ yycompile(f) eval_tree = 0; newline_seen = 0; + heredoc_end = 0; sourcefile = f; rb_in_compile = 1; n = yyparse(); diff --git a/version.h b/version.h index 4a754e9d9e..373c3983d8 100644 --- a/version.h +++ b/version.h @@ -1,2 +1,2 @@ -#define RUBY_VERSION "1.2.2" -#define VERSION_DATE "99/01/21" +#define RUBY_VERSION "1.2.3" +#define VERSION_DATE "99/02/09" -- cgit v1.2.3