From 51fa86ece2d2b0f72c86c70fe1314e412c7a9e68 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 15 Feb 1999 07:31:51 +0000 Subject: 990215 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 16 +++ array.c | 2 +- configure | 257 ++++++++++++++++++++++++++++++------------------ configure.in | 26 +---- eval.c | 38 ++----- ext/Win32API/Win32API.c | 6 ++ io.c | 2 +- process.c | 8 +- sprintf.c | 1 + version.h | 2 +- win32/ruby.def | 2 - 11 files changed, 201 insertions(+), 159 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3ad3d99e69..555553c55f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +Mon Feb 15 15:48:30 1999 WATANABE Hirofumi + + * configure.in: specify `-Wl,-E' only for GNU ld. + +Mon Feb 15 11:43:22 1999 GOTO Kentaro + + * array.c (rb_inspecting_p): should return Qfalse. + +Sun Feb 14 22:36:40 1999 EGUCHI Osamu + + * sprintf.c (rb_f_sprintf): `%G' was ommited. + +Sat Feb 13 01:24:16 1999 Yukihiro Matsumoto + + * eval.c (rb_thread_create_0): should protect th->thread. + Fri Feb 12 16:16:47 1999 Yasuhiro Fukuma * string.c (rb_str_inspect): wrong mbc position. diff --git a/array.c b/array.c index a9de53f228..8b0d379999 100644 --- a/array.c +++ b/array.c @@ -821,7 +821,7 @@ rb_inspecting_p(obj) inspect_tbl = rb_thread_local_aref(rb_thread_current(), inspect_key); if (NIL_P(inspect_tbl)) return Qfalse; #else - if (!inspect_tbl) return Qnil; + if (!inspect_tbl) return Qfalse; #endif return rb_ary_includes(inspect_tbl, obj); } diff --git a/configure b/configure index 91025fb80c..103020a187 100644 --- a/configure +++ b/configure @@ -3263,85 +3263,148 @@ EOF fi fi -if test "$ac_cv_func_setpgrp2" = yes; then - cat >> confdefs.h <<\EOF -#define BSD_GETPGRP getpgrp2 -EOF - - cat >> confdefs.h <<\EOF -#define BSD_SETPGRP setpgrp2 -EOF - -else - echo $ac_n "checking whether getpgrp() has arg""... $ac_c" 1>&6 -echo "configure:3278: checking whether getpgrp() has arg" >&5 -if eval "test \"`echo '$''{'rb_cv_bsdgetpgrp'+set}'`\" = set"; then +echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 +echo "configure:3268: checking whether getpgrp takes no argument" >&5 +if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < -int main() { -getpgrp(0); -; return 0; } + +/* + * If this system has a BSD-style getpgrp(), + * which takes a pid argument, exit unsuccessfully. + * + * Snarfed from Chet Ramey's bash pgrp.c test program + */ +#include +#include + +int pid; +int pg1, pg2, pg3, pg4; +int ng, np, s, child; + +main() +{ + pid = getpid(); + pg1 = getpgrp(0); + pg2 = getpgrp(); + pg3 = getpgrp(pid); + pg4 = getpgrp(1); + + /* + * If all of these values are the same, it's pretty sure that + * we're on a system that ignores getpgrp's first argument. + */ + if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3) + exit(0); + + child = fork(); + if (child < 0) + exit(1); + else if (child == 0) { + np = getpid(); + /* + * If this is Sys V, this will not work; pgrp will be + * set to np because setpgrp just changes a pgrp to be + * the same as the pid. + */ + setpgrp(np, pg1); + ng = getpgrp(0); /* Same result for Sys V and BSD */ + if (ng == pg1) { + exit(1); + } else { + exit(0); + } + } else { + wait(&s); + exit(s>>8); + } +} + EOF -if { (eval echo configure:3290: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - rb_cv_bsdgetpgrp=yes +if { (eval echo configure:3331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_func_getpgrp_void=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - rb_cv_bsdgetpgrp=no + rm -fr conftest* + ac_cv_func_getpgrp_void=no fi -rm -f conftest* +rm -fr conftest* fi -echo "$ac_t""$rb_cv_bsdgetpgrp" 1>&6 - if test "$rb_cv_bsdgetpgrp" = yes; then - cat >> confdefs.h <<\EOF -#define BSD_GETPGRP getpgrp + +fi + +echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6 +if test $ac_cv_func_getpgrp_void = yes; then + cat >> confdefs.h <<\EOF +#define GETPGRP_VOID 1 EOF - fi +fi - echo $ac_n "checking whether setpgrp() has args""... $ac_c" 1>&6 -echo "configure:3311: checking whether setpgrp() has args" >&5 -if eval "test \"`echo '$''{'rb_cv_bsdsetpgrp'+set}'`\" = set"; then +echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 +echo "configure:3355: checking whether setpgrp takes no argument" >&5 +if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < -int main() { -setpgrp(1, 1); -; return 0; } +#endif + +/* + * If this system has a BSD-style setpgrp, which takes arguments, exit + * successfully. + */ +main() +{ + if (setpgrp(1,1) == -1) + exit(0); + else + exit(1); +} + EOF -if { (eval echo configure:3323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - rb_cv_bsdsetpgrp=yes +if { (eval echo configure:3383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_func_setpgrp_void=no else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 - rm -rf conftest* - rb_cv_bsdsetpgrp=no + rm -fr conftest* + ac_cv_func_setpgrp_void=yes fi -rm -f conftest* +rm -fr conftest* fi -echo "$ac_t""$rb_cv_bsdsetpgrp" 1>&6 - if test "$rb_cv_bsdsetpgrp" = yes; then - cat >> confdefs.h <<\EOF -#define BSD_SETPGRP setpgrp + +fi + +echo "$ac_t""$ac_cv_func_setpgrp_void" 1>&6 +if test $ac_cv_func_setpgrp_void = yes; then + cat >> confdefs.h <<\EOF +#define SETPGRP_VOID 1 EOF - fi fi + echo $ac_n "checking for working strtod""... $ac_c" 1>&6 -echo "configure:3345: checking for working strtod" >&5 +echo "configure:3408: checking for working strtod" >&5 if eval "test \"`echo '$''{'rb_cv_func_strtod'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3349,7 +3412,7 @@ else rb_cv_func_strtod=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then rb_cv_func_strtod=yes else @@ -3397,14 +3460,14 @@ echo "$ac_t""$rb_cv_func_strtod" 1>&6 test $rb_cv_func_strtod = no && LIBOBJS="$LIBOBJS strtod.o" echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:3401: checking whether byte ordering is bigendian" >&5 +echo "configure:3464: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -3415,11 +3478,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:3419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -3430,7 +3493,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:3434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -3450,7 +3513,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -3487,14 +3550,14 @@ EOF fi echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6 -echo "configure:3491: checking whether char is unsigned" >&5 +echo "configure:3554: checking whether char is unsigned" >&5 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$GCC" = yes; then # GCC predefines this symbol on systems where it applies. cat > conftest.$ac_ext <&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_char_unsigned=yes else @@ -3551,7 +3614,7 @@ fi echo $ac_n "checking whether right shift preserve sign bit""... $ac_c" 1>&6 -echo "configure:3555: checking whether right shift preserve sign bit" >&5 +echo "configure:3618: checking whether right shift preserve sign bit" >&5 if eval "test \"`echo '$''{'rb_cv_rshift_sign'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3559,7 +3622,7 @@ else rb_cv_rshift_sign=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then rb_cv_rshift_sign=yes else @@ -3599,19 +3662,19 @@ EOF fi echo $ac_n "checking count field in FILE structures""... $ac_c" 1>&6 -echo "configure:3603: checking count field in FILE structures" >&5 +echo "configure:3666: checking count field in FILE structures" >&5 if eval "test \"`echo '$''{'rb_cv_fcnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { FILE *f = stdin; f->_cnt = 0; ; return 0; } EOF -if { (eval echo configure:3615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="_cnt" else @@ -3621,14 +3684,14 @@ fi rm -f conftest* if test "$rb_cv_fcnt" = ""; then cat > conftest.$ac_ext < int main() { FILE *f = stdin; f->__cnt = 0; ; return 0; } EOF -if { (eval echo configure:3632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3695: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="__cnt" else @@ -3639,14 +3702,14 @@ rm -f conftest* fi if test "$rb_cv_fcnt" = ""; then cat > conftest.$ac_ext < int main() { FILE *f = stdin; f->_r = 0; ; return 0; } EOF -if { (eval echo configure:3650: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3713: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="_r" else @@ -3657,14 +3720,14 @@ rm -f conftest* fi if test "$rb_cv_fcnt" = ""; then cat > conftest.$ac_ext < int main() { FILE *f = stdin; f->readCount = 0; ; return 0; } EOF -if { (eval echo configure:3668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_fcnt="readCount" else @@ -3703,7 +3766,7 @@ fi case "$host_os" in linux*) echo $ac_n "checking whether ELF binaries are produced""... $ac_c" 1>&6 -echo "configure:3707: checking whether ELF binaries are produced" >&5 +echo "configure:3770: checking whether ELF binaries are produced" >&5 if eval "test \"`echo '$''{'rb_cv_binary_elf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3711,7 +3774,7 @@ else rb_cv_binary_elf=yes else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then rb_cv_binary_elf=yes else @@ -3761,7 +3824,7 @@ STATIC= if test "$with_dln_a_out" != yes; then rb_cv_dlopen=unknown echo $ac_n "checking whether OS depend dynamic link works""... $ac_c" 1>&6 -echo "configure:3765: checking whether OS depend dynamic link works" >&5 +echo "configure:3828: checking whether OS depend dynamic link works" >&5 if test "$GCC" = yes; then case "$host_os" in nextstep*) ;; @@ -3787,7 +3850,7 @@ echo "configure:3765: checking whether OS depend dynamic link works" >&5 LDFLAGS="-Wl,-E" rb_cv_dlopen=yes;; solaris*) LDSHARED='ld -G' - LDFLAGS="-Wl,-E" + test "$GCC" = yes && `$CC --print-prog-name=ld` -v 2>&1 | grep "GNU ld" > /dev/null && LDFLAGS="-Wl,-E" rb_cv_dlopen=yes;; sunos*) LDSHARED='ld -assert nodefinitions' rb_cv_dlopen=yes;; @@ -3855,12 +3918,12 @@ if test "$ac_cv_header_a_out_h" = yes; then if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then cat confdefs.h > config.h echo $ac_n "checking whether matz's dln works""... $ac_c" 1>&6 -echo "configure:3859: checking whether matz's dln works" >&5 +echo "configure:3922: checking whether matz's dln works" >&5 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:3937: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* rb_cv_dln_a_out=yes else @@ -3972,7 +4035,7 @@ fi case "$host_os" in human*) echo $ac_n "checking for _harderr in -lsignal""... $ac_c" 1>&6 -echo "configure:3976: checking for _harderr in -lsignal" >&5 +echo "configure:4039: 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 @@ -3980,7 +4043,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsignal $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4019,7 +4082,7 @@ else fi echo $ac_n "checking for hmemset in -lhmem""... $ac_c" 1>&6 -echo "configure:4023: checking for hmemset in -lhmem" >&5 +echo "configure:4086: 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 @@ -4027,7 +4090,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lhmem $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4068,12 +4131,12 @@ fi for ac_func in select do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4072: checking for $ac_func" >&5 +echo "configure:4135: 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${ac_exeext}; then +if { (eval echo configure:4163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4121,7 +4184,7 @@ fi done echo $ac_n "checking whether PD libc _dtos18 fail to convert big number""... $ac_c" 1>&6 -echo "configure:4125: checking whether PD libc _dtos18 fail to convert big number" >&5 +echo "configure:4188: 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 @@ -4129,7 +4192,7 @@ else rb_cv_missing__dtos18=no else cat > conftest.$ac_ext < @@ -4141,7 +4204,7 @@ main () } EOF -if { (eval echo configure:4145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then rb_cv_missing__dtos18=yes else @@ -4163,7 +4226,7 @@ EOF fi echo $ac_n "checking whether PD libc fconvert fail to round""... $ac_c" 1>&6 -echo "configure:4167: checking whether PD libc fconvert fail to round" >&5 +echo "configure:4230: 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 @@ -4171,7 +4234,7 @@ else rb_cv_missing_fconvert=no else cat > conftest.$ac_ext < @@ -4184,7 +4247,7 @@ main () } EOF -if { (eval echo configure:4188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then rb_cv_missing_fconvert=yes else @@ -4306,7 +4369,7 @@ ri_prefix= test "$program_prefix" != NONE && ri_prefix=$program_prefix -ri_suffix="${MAJOR}.${MINOR}" +ri_suffix= test "$program_suffix" != NONE && ri_suffix=$program_suffix diff --git a/configure.in b/configure.in index 069cffba8e..26945dd0d9 100644 --- a/configure.in +++ b/configure.in @@ -230,26 +230,8 @@ main() fi fi -if test "$ac_cv_func_setpgrp2" = yes; then - AC_DEFINE(BSD_GETPGRP, getpgrp2) - AC_DEFINE(BSD_SETPGRP, setpgrp2) -else - AC_CACHE_CHECK(whether getpgrp() has arg, rb_cv_bsdgetpgrp, - [AC_TRY_COMPILE([#include ], [getpgrp(0);], - rb_cv_bsdgetpgrp=yes, - rb_cv_bsdgetpgrp=no)]) - if test "$rb_cv_bsdgetpgrp" = yes; then - AC_DEFINE(BSD_GETPGRP, getpgrp) - fi - - AC_CACHE_CHECK(whether setpgrp() has args, rb_cv_bsdsetpgrp, - [AC_TRY_COMPILE([#include ], [setpgrp(1, 1);], - rb_cv_bsdsetpgrp=yes, - rb_cv_bsdsetpgrp=no)]) - if test "$rb_cv_bsdsetpgrp" = yes; then - AC_DEFINE(BSD_SETPGRP, setpgrp) - fi -fi +AC_FUNC_GETPGRP +AC_FUNC_SETPGRP AC_CACHE_CHECK(for working strtod, rb_cv_func_strtod, [AC_TRY_RUN([ @@ -402,7 +384,7 @@ if test "$with_dln_a_out" != yes; then LDFLAGS="-Wl,-E" rb_cv_dlopen=yes;; solaris*) LDSHARED='ld -G' - LDFLAGS="-Wl,-E" + test "$GCC" = yes && `$CC --print-prog-name=ld` -v 2>&1 | grep "GNU ld" > /dev/null && LDFLAGS="-Wl,-E" rb_cv_dlopen=yes;; sunos*) LDSHARED='ld -assert nodefinitions' rb_cv_dlopen=yes;; @@ -681,7 +663,7 @@ ri_prefix= test "$program_prefix" != NONE && ri_prefix=$program_prefix -ri_suffix="${MAJOR}.${MINOR}" +ri_suffix= test "$program_suffix" != NONE && ri_suffix=$program_suffix diff --git a/eval.c b/eval.c index 9246d6267a..7e1e6c74e1 100644 --- a/eval.c +++ b/eval.c @@ -6103,45 +6103,21 @@ rb_thread_fd_close(fd) END_FOREACH(th); } -static void -rb_thread_badf() -{ - thread_t th; - int max; - struct timeval delay_tv; - fd_set readfds; - - delay_tv.tv_sec = 0; - delay_tv.tv_usec = 0; - FOREACH_THREAD(th) { - if (th->wait_for & WAIT_FD) { - FD_ZERO(&readfds); - FD_SET(th->fd, &readfds); - if (select(th->fd+1, &readfds, 0, 0, &delay_tv) < 0 && - errno == EBADF) { - rb_thread_ready(th); - th->status = THREAD_TO_KILL; - } - } - } - END_FOREACH(th); -} - static void rb_thread_deadlock() { - static int invoked = 0; - - if (invoked) return; - invoked = 1; +#if 1 curr_thread = main_thread; -#if 0 th_raise_argc = 1; th_raise_argv[0] = rb_exc_new2(rb_eFatal, "Thread: deadlock"); th_raise_file = ruby_sourcefile; th_raise_line = ruby_sourceline; rb_thread_restore_context(main_thread, RESTORE_RAISE); #else + static int invoked = 0; + + if (invoked) return; + invoked = 1; rb_prohibit_interrupt = 1; ruby_errinfo = rb_exc_new2(rb_eFatal, "Thread: deadlock"); set_backtrace(ruby_errinfo, make_backtrace()); @@ -6250,7 +6226,6 @@ rb_thread_schedule() if (rb_trap_pending) rb_trap_exec(); switch (errno) { case EBADF: - rb_thread_badf(); case ENOMEM: n = 0; break; @@ -6775,6 +6750,7 @@ rb_thread_create_0(fn, arg, klass) VALUE klass; { thread_t th = rb_thread_alloc(klass); + volatile VALUE thread = th->thread; enum thread_status status; int state; @@ -6794,7 +6770,7 @@ rb_thread_create_0(fn, arg, klass) FL_SET(ruby_scope, SCOPE_SHARED); rb_thread_save_context(curr_thread); if (setjmp(curr_thread->context)) { - return th->thread; + return thread; } PUSH_TAG(PROT_THREAD); diff --git a/ext/Win32API/Win32API.c b/ext/Win32API/Win32API.c index 86d72769b7..b57cf8101f 100644 --- a/ext/Win32API/Win32API.c +++ b/ext/Win32API/Win32API.c @@ -223,3 +223,9 @@ Init_Win32API() rb_define_method(cWin32API, "call", Win32API_Call, -1); rb_define_alias(cWin32API, "Call", "call"); } + +void +Init_win32api() +{ + Init_Win32API(); +} diff --git a/io.c b/io.c index 3223c893d8..24122f9e13 100644 --- a/io.c +++ b/io.c @@ -1136,7 +1136,7 @@ static int rb_open(fname, flag, mode) char *fname; int flag; - mode_t mode; + unsigned int mode; { int fd; diff --git a/process.c b/process.c index 3318e556c2..8257812b91 100644 --- a/process.c +++ b/process.c @@ -782,13 +782,13 @@ proc_getpgrp(argc, argv) VALUE *argv; { int pgrp; -#ifdef BSD_GETPGRP +#ifndef GETPGRP_VOID VALUE vpid; int pid; rb_scan_args(argc, argv, "01", &vpid); pid = NIL_P(vpid)?0:NUM2INT(vpid); - pgrp = BSD_GETPGRP(pid); + pgrp = getpgrp(pid); #else rb_scan_args(argc, argv, "0"); pgrp = getpgrp(); @@ -803,7 +803,7 @@ proc_setpgrp(argc, argv) VALUE *argv; { #ifdef HAVE_SETPGRP -#ifdef BSD_SETPGRP +#ifndef SETPGRP_VOID VALUE pid, pgrp; int ipid, ipgrp; @@ -811,7 +811,7 @@ proc_setpgrp(argc, argv) ipid = NIL_P(pid)?0:NUM2INT(pid); ipgrp = NIL_P(pgrp)?0:NUM2INT(pgrp); - if (BSD_SETPGRP(ipid, ipgrp) < 0) rb_sys_fail(0); + if (setpgrp(ipid, ipgrp) < 0) rb_sys_fail(0); #else rb_scan_args(argc, argv, "0"); if (setpgrp() < 0) rb_sys_fail(0); diff --git a/sprintf.c b/sprintf.c index eddb9024e5..71e5488bce 100644 --- a/sprintf.c +++ b/sprintf.c @@ -556,6 +556,7 @@ rb_f_sprintf(argc, argv) case 'f': case 'g': + case 'G': case 'e': case 'E': { diff --git a/version.h b/version.h index a74ab03ef6..fadead04a2 100644 --- a/version.h +++ b/version.h @@ -1,2 +1,2 @@ #define RUBY_VERSION "1.3.1" -#define VERSION_DATE "99/02/12" +#define VERSION_DATE "99/02/15" diff --git a/win32/ruby.def b/win32/ruby.def index 3c6f9c3e56..6c391dcff4 100644 --- a/win32/ruby.def +++ b/win32/ruby.def @@ -272,11 +272,9 @@ EXPORTS rb_io_fptr_finalize rb_io_close rb_io_binmode - rb_io_mode_flags rb_fopen rb_fdopen rb_io_unbuffered - rb_io_reopen rb_str_setter ; numeric.c rb_num_zerodiv -- cgit v1.2.3