1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

2000-01-24

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-01-24 03:46:14 +00:00
parent 2d2bbb9677
commit 1af83e4997
10 changed files with 141 additions and 69 deletions

View file

@ -1,3 +1,7 @@
Sun Jan 16 20:12:13 2000 Koji Arai <JCA02266@nifty.ne.jp>
* eval.c (dvar_asgn): may need to push dvar.
Sat Jan 15 22:21:08 2000 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp> Sat Jan 15 22:21:08 2000 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* eval.c (search_method): argument klass may be 0. * eval.c (search_method): argument klass may be 0.

63
configure vendored
View file

@ -4015,6 +4015,14 @@ echo "$ac_t""$rb_cv_binary_elf" 1>&6
else else
LDFLAGS="-rdynamic" LDFLAGS="-rdynamic"
fi;; fi;;
netbsd*)
if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]
then
netbsd_elf=yes
else
netbsd_elf=no
fi
;;
esac esac
@ -4024,7 +4032,7 @@ STATIC=
if test "$with_dln_a_out" != yes; then if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=unknown rb_cv_dlopen=unknown
echo $ac_n "checking whether OS depend dynamic link works""... $ac_c" 1>&6 echo $ac_n "checking whether OS depend dynamic link works""... $ac_c" 1>&6
echo "configure:4028: checking whether OS depend dynamic link works" >&5 echo "configure:4036: checking whether OS depend dynamic link works" >&5
if test "$GCC" = yes; then if test "$GCC" = yes; then
case "$host_os" in case "$host_os" in
nextstep*) ;; nextstep*) ;;
@ -4085,11 +4093,10 @@ echo "configure:4028: checking whether OS depend dynamic link works" >&5
test "$GCC" = yes && `$CC --print-prog-name=ld` -v 2>&1 | grep "GNU ld" > /dev/null || LDSHARED="ld -Bshareable" test "$GCC" = yes && `$CC --print-prog-name=ld` -v 2>&1 | grep "GNU ld" > /dev/null || LDSHARED="ld -Bshareable"
fi fi
rb_cv_dlopen=yes ;; rb_cv_dlopen=yes ;;
netbsd*) LDSHARED="ld -shared" netbsd*) if test x"$netbsd_elf" = x"yes"; then
case "$host_cpu" in LDFLAGS="-export-dynamic"
alpha) fi
LDFLAGS="-export-dynamic" ;; LDSHARED="ld -shared"
esac
rb_cv_dlopen=yes ;; rb_cv_dlopen=yes ;;
openbsd*) LDSHARED="ld -Bforcearchive -Bshareable" openbsd*) LDSHARED="ld -Bforcearchive -Bshareable"
rb_cv_dlopen=yes ;; rb_cv_dlopen=yes ;;
@ -4146,12 +4153,12 @@ if test "$ac_cv_header_a_out_h" = yes; then
if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then
cat confdefs.h > config.h cat confdefs.h > config.h
echo $ac_n "checking whether matz's dln works""... $ac_c" 1>&6 echo $ac_n "checking whether matz's dln works""... $ac_c" 1>&6
echo "configure:4150: checking whether matz's dln works" >&5 echo "configure:4157: checking whether matz's dln works" >&5
if eval "test \"`echo '$''{'rb_cv_dln_a_out'+set}'`\" = set"; then if eval "test \"`echo '$''{'rb_cv_dln_a_out'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4155 "configure" #line 4162 "configure"
#include "confdefs.h" #include "confdefs.h"
#define USE_DLN_A_OUT #define USE_DLN_A_OUT
@ -4161,7 +4168,7 @@ int main() {
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:4165: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then if { (eval echo configure:4172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest* rm -rf conftest*
rb_cv_dln_a_out=yes rb_cv_dln_a_out=yes
else else
@ -4268,7 +4275,7 @@ fi
case "$host_os" in case "$host_os" in
human*) human*)
echo $ac_n "checking for _harderr in -lsignal""... $ac_c" 1>&6 echo $ac_n "checking for _harderr in -lsignal""... $ac_c" 1>&6
echo "configure:4272: checking for _harderr in -lsignal" >&5 echo "configure:4279: checking for _harderr in -lsignal" >&5
ac_lib_var=`echo signal'_'_harderr | sed 'y%./+-%__p_%'` ac_lib_var=`echo signal'_'_harderr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -4276,7 +4283,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lsignal $LIBS" LIBS="-lsignal $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4280 "configure" #line 4287 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -4287,7 +4294,7 @@ int main() {
_harderr() _harderr()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:4291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:4298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -4315,7 +4322,7 @@ else
fi fi
echo $ac_n "checking for hmemset in -lhmem""... $ac_c" 1>&6 echo $ac_n "checking for hmemset in -lhmem""... $ac_c" 1>&6
echo "configure:4319: checking for hmemset in -lhmem" >&5 echo "configure:4326: checking for hmemset in -lhmem" >&5
ac_lib_var=`echo hmem'_'hmemset | sed 'y%./+-%__p_%'` ac_lib_var=`echo hmem'_'hmemset | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -4323,7 +4330,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lhmem $LIBS" LIBS="-lhmem $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4327 "configure" #line 4334 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -4334,7 +4341,7 @@ int main() {
hmemset() hmemset()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:4338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:4345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -4364,12 +4371,12 @@ fi
for ac_func in select gettimeofday for ac_func in select gettimeofday
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4368: checking for $ac_func" >&5 echo "configure:4375: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4373 "configure" #line 4380 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
@ -4392,7 +4399,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:4396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:4403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else
@ -4417,7 +4424,7 @@ fi
done done
echo $ac_n "checking whether PD libc _dtos18 fail to convert big number""... $ac_c" 1>&6 echo $ac_n "checking whether PD libc _dtos18 fail to convert big number""... $ac_c" 1>&6
echo "configure:4421: checking whether PD libc _dtos18 fail to convert big number" >&5 echo "configure:4428: checking whether PD libc _dtos18 fail to convert big number" >&5
if eval "test \"`echo '$''{'rb_cv_missing__dtos18'+set}'`\" = set"; then if eval "test \"`echo '$''{'rb_cv_missing__dtos18'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -4425,7 +4432,7 @@ else
rb_cv_missing__dtos18=no rb_cv_missing__dtos18=no
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4429 "configure" #line 4436 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdio.h> #include <stdio.h>
@ -4437,7 +4444,7 @@ main ()
} }
EOF EOF
if { (eval echo configure:4441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null if { (eval echo configure:4448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then then
rb_cv_missing__dtos18=yes rb_cv_missing__dtos18=yes
else else
@ -4459,7 +4466,7 @@ EOF
fi fi
echo $ac_n "checking whether PD libc fconvert fail to round""... $ac_c" 1>&6 echo $ac_n "checking whether PD libc fconvert fail to round""... $ac_c" 1>&6
echo "configure:4463: checking whether PD libc fconvert fail to round" >&5 echo "configure:4470: checking whether PD libc fconvert fail to round" >&5
if eval "test \"`echo '$''{'rb_cv_missing_fconvert'+set}'`\" = set"; then if eval "test \"`echo '$''{'rb_cv_missing_fconvert'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -4467,7 +4474,7 @@ else
rb_cv_missing_fconvert=no rb_cv_missing_fconvert=no
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4471 "configure" #line 4478 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdio.h> #include <stdio.h>
@ -4480,7 +4487,7 @@ main ()
} }
EOF EOF
if { (eval echo configure:4484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null if { (eval echo configure:4491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then then
rb_cv_missing_fconvert=yes rb_cv_missing_fconvert=yes
else else
@ -4585,11 +4592,9 @@ if test "$enable_shared" = 'yes'; then
;; ;;
netbsd*) netbsd*)
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR)' LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR)'
case "$host_cpu" in if test x"$netbsd_elf" = "xyes"; then
alpha|mipsel|mipseb|powerpc|sparc64) # ELF platforms LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR) lib$(RUBY_INSTALL_NAME).so'
LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR) lib$(RUBY_INSTALL_NAME).so' ;; fi
*) LIBRUBY_ALIASES= ;; # a.out platforms
esac
;; ;;
solaris*) solaris*)
XLDFLAGS='-R${prefix}/lib' XLDFLAGS='-R${prefix}/lib'

View file

@ -260,7 +260,7 @@ AC_CACHE_CHECK(whether right shift preserve sign bit, rb_cv_rshift_sign,
int int
main() main()
{ {
if (-1==(-1>>(unsigned)1)) if (-1==(-1>>1))
return 0; return 0;
return 1; return 1;
} }
@ -269,7 +269,7 @@ main()
rb_cv_rshift_sign=no, rb_cv_rshift_sign=no,
rb_cv_rshift_sign=yes)]) rb_cv_rshift_sign=yes)])
if test "$rb_cv_rshift_sign" = yes; then if test "$rb_cv_rshift_sign" = yes; then
AC_DEFINE(RSHIFT(x,y), ((x)>>y)) AC_DEFINE(RSHIFT(x,y), ((x)>>(int)y))
else else
AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>y) : (x)>>y)) AC_DEFINE(RSHIFT(x,y), (((x)<0) ? ~((~(x))>>y) : (x)>>y))
fi fi
@ -309,10 +309,14 @@ AC_SUBST(DEFAULT_KCODE)
AC_ARG_WITH(default-kcode, AC_ARG_WITH(default-kcode,
[--with-default-kcode=CODE specify default value for \$KCODE (utf8|euc|sjis|none)], [--with-default-kcode=CODE specify default value for \$KCODE (utf8|euc|sjis|none)],
[case $withval in [case $withval in
utf8) AC_DEFINE(DEFAULT_KCODE, KCODE_UTF8);; utf8) AC_DEFINE(DEFAULT_KCODE, KCODE_UTF8)
euc) AC_DEFINE(DEFAULT_KCODE, KCODE_EUC);; DEFAULT_KCODE="KCODE_UTF8";;
sjis) AC_DEFINE(DEFAULT_KCODE, KCODE_SJIS);; euc) AC_DEFINE(DEFAULT_KCODE, KCODE_EUC)
none) AC_DEFINE(DEFAULT_KCODE, KCODE_NONE);; DEFAULT_KCODE="KCODE_EUC";;
sjis) AC_DEFINE(DEFAULT_KCODE, KCODE_SJIS)
DEFAULT_KCODE="KCODE_SJIS";;
none) AC_DEFINE(DEFAULT_KCODE, KCODE_NONE)
DEFAULT_KCODE="KCODE_NONE";;
*) AC_MSG_WARN($withval is not valid kcode; ignored);; *) AC_MSG_WARN($withval is not valid kcode; ignored);;
esac]) esac])
@ -326,10 +330,8 @@ AC_ARG_WITH(dln-a-out,
AC_SUBST(XLDFLAGS)dnl AC_SUBST(XLDFLAGS)dnl
case "$host_os" in AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf,
linux*) [AC_TRY_RUN([
AC_CACHE_CHECK(whether ELF binaries are produced, rb_cv_binary_elf,
[AC_TRY_RUN([
/* Test for whether ELF binaries are produced */ /* Test for whether ELF binaries are produced */
#include <fcntl.h> #include <fcntl.h>
#include <stdlib.h> #include <stdlib.h>
@ -346,15 +348,30 @@ main() {
exit(0); /* succeed (yes, it's ELF) */ exit(0); /* succeed (yes, it's ELF) */
} }
], ],
rb_cv_binary_elf=yes, rb_cv_binary_elf=yes,
rb_cv_binary_elf=no, rb_cv_binary_elf=no,
rb_cv_binary_elf=yes)]) rb_cv_binary_elf=yes)])
if test "$rb_cv_binary_elf" = yes; then
AC_DEFINE(USE_ELF)
fi
case "$target_os" in
linux*)
if test "$rb_cv_binary_elf" = no; then if test "$rb_cv_binary_elf" = no; then
with_dln_a_out=yes with_dln_a_out=yes
host_os=${host_os}-a_out host_os=${host_os}-a_out
else else
LDFLAGS="-rdynamic" LDFLAGS="-rdynamic"
fi;; fi;;
netbsd*)
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
then
netbsd_elf=yes
else
netbsd_elf=no
fi
;;
esac esac
AC_SUBST(DLDFLAGS)dnl AC_SUBST(DLDFLAGS)dnl
@ -387,9 +404,8 @@ if test "$with_dln_a_out" != yes; then
else else
case "$host_os" in case "$host_os" in
hpux*) CCDLFLAGS='+z';; hpux*) CCDLFLAGS='+z';;
solaris*) CCDLFLAGS='-K PIC' ;; solaris*|irix*) CCDLFLAGS='-K PIC' ;;
sunos*) CCDLFLAGS='-PIC' ;; sunos*) CCDLFLAGS='-PIC' ;;
irix*) CCDLFLAGS='-KPIC' ;;
esix*|uxpds*) CCDLFLAGS='-KPIC' ;; esix*|uxpds*) CCDLFLAGS='-KPIC' ;;
*) CCDLFLAGS='' ;; *) CCDLFLAGS='' ;;
esac esac
@ -409,7 +425,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 -shared' irix*) LDSHARED='ld -ignore_unresolved'
rb_cv_dlopen=yes;; rb_cv_dlopen=yes;;
sysv4*) LDSHARED='ld -G' sysv4*) LDSHARED='ld -G'
rb_cv_dlopen=yes;; rb_cv_dlopen=yes;;
@ -420,20 +436,17 @@ if test "$with_dln_a_out" != yes; then
linux*) LDSHARED="$CC -shared" linux*) LDSHARED="$CC -shared"
rb_cv_dlopen=yes ;; rb_cv_dlopen=yes ;;
freebsd*) LDSHARED="$CC -shared" freebsd*) LDSHARED="$CC -shared"
if test -x /usr/bin/objformat && \ if test "$rb_cv_binary_elf" = yes; then
test `/usr/bin/objformat` = "elf" ; then
LDFLAGS="-rdynamic" LDFLAGS="-rdynamic"
DLDFLAGS='-Wl,-soname,$(.TARGET)' DLDFLAGS='-Wl,-soname,$(.TARGET)'
rb_cv_freebsd_elf=yes
else else
test "$GCC" = yes && `$CC --print-prog-name=ld` -v 2>&1 | grep "GNU ld" > /dev/null || LDSHARED="ld -Bshareable" test "$GCC" = yes && `$CC --print-prog-name=ld` -v 2>&1 | grep "GNU ld" > /dev/null || LDSHARED="ld -Bshareable"
fi fi
rb_cv_dlopen=yes ;; rb_cv_dlopen=yes ;;
netbsd*) LDSHARED="ld -shared" netbsd*) LDSHARED="ld -shared"
case "$host_cpu" in if test "$rb_cv_binary_elf" = yes; then
alpha) LDFLAGS="-export-dynamic"
LDFLAGS="-export-dynamic" ;; fi
esac
rb_cv_dlopen=yes ;; rb_cv_dlopen=yes ;;
openbsd*) LDSHARED="ld -Bforcearchive -Bshareable" openbsd*) LDSHARED="ld -Bforcearchive -Bshareable"
rb_cv_dlopen=yes ;; rb_cv_dlopen=yes ;;
@ -677,18 +690,18 @@ if test "$enable_shared" = 'yes'; then
;; ;;
freebsd*) freebsd*)
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR)$(MINOR)' LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR)$(MINOR)'
if test "$rb_cv_freebsd_elf" != "yes" ; then if test "$rb_cv_binary_elf" != "yes" ; then
LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)" LIBRUBY_SO="$LIBRUBY_SO.\$(TEENY)"
LIBRUBY_ALIASES='' LIBRUBY_ALIASES=''
fi fi
;; ;;
netbsd*) netbsd*)
LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR)' LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR)'
case "$host_cpu" in if test "$rb_cv_binary_elf" = yes; then # ELF platforms
alpha|mipsel|mipseb|powerpc|sparc64) # ELF platforms LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR) lib$(RUBY_INSTALL_NAME).so'
LIBRUBY_ALIASES='lib$(RUBY_INSTALL_NAME).so.$(MAJOR) lib$(RUBY_INSTALL_NAME).so' ;; else
*) LIBRUBY_ALIASES= ;; # a.out platforms LIBRUBY_ALIASES= # a.out platforms
esac fi
;; ;;
solaris*) solaris*)
XLDFLAGS='-R${prefix}/lib' XLDFLAGS='-R${prefix}/lib'

2
dln.c
View file

@ -80,7 +80,7 @@ int eaccess();
#endif #endif
#ifndef FUNCNAME_PATTERN #ifndef FUNCNAME_PATTERN
# if defined(__hp9000s300) || (defined(__NetBSD__) && (!defined(__alpha__) && !defined(__mips__))) || defined(__BORLANDC__) || (defined(__FreeBSD__) && __FreeBSD__ < 3) || defined(__OpenBSD__) || defined(NeXT) || defined(__WATCOMC__) || defined(__APPLE__) # if defined(__hp9000s300) || (defined(__NetBSD__) && !defined(__ELF__)) || defined(__BORLANDC__) || (defined(__FreeBSD__) && __FreeBSD__ < 3) || defined(__OpenBSD__) || defined(NeXT) || defined(__WATCOMC__) || defined(__APPLE__)
# define FUNCNAME_PATTERN "_Init_%.200s" # define FUNCNAME_PATTERN "_Init_%.200s"
# else # else
# define FUNCNAME_PATTERN "Init_%.200s" # define FUNCNAME_PATTERN "Init_%.200s"

15
eval.c
View file

@ -556,14 +556,27 @@ dvar_asgn(id, value, push)
struct RVarmap *vars = ruby_dyna_vars; struct RVarmap *vars = ruby_dyna_vars;
while (vars) { while (vars) {
if (push && vars->id == 0) break; if (push && vars->id == 0) {
rb_dvar_push(id, value);
return;
}
if (vars->id == id) { if (vars->id == id) {
vars->val = value; vars->val = value;
return; return;
} }
vars = vars->next; vars = vars->next;
} }
vars = 0;
if (ruby_dyna_vars && ruby_dyna_vars->id == 0) {
vars = ruby_dyna_vars;
ruby_dyna_vars = ruby_dyna_vars->next;
}
rb_dvar_push(id, value); rb_dvar_push(id, value);
if (vars) {
vars->next = ruby_dyna_vars;
ruby_dyna_vars = vars;
}
} }
void void

View file

@ -41,6 +41,7 @@ end
$ipv6type = nil $ipv6type = nil
$ipv6lib = nil $ipv6lib = nil
$ipv6libdir = nil $ipv6libdir = nil
$ipv6trylibc = nil
if $ipv6 if $ipv6
if egrep_cpp("yes", <<EOF) if egrep_cpp("yes", <<EOF)
#include <netinet/in.h> #include <netinet/in.h>
@ -59,6 +60,7 @@ EOF
$ipv6type = "kame" $ipv6type = "kame"
$ipv6lib="inet6" $ipv6lib="inet6"
$ipv6libdir="/usr/local/v6/lib" $ipv6libdir="/usr/local/v6/lib"
$ipv6trylibc=true
$CFLAGS="-DINET6 "+$CFLAGS $CFLAGS="-DINET6 "+$CFLAGS
elsif File.directory? "/usr/inet6" elsif File.directory? "/usr/inet6"
$ipv6type = "linux" $ipv6type = "linux"
@ -100,7 +102,7 @@ EOF
if $ipv6lib if $ipv6lib
if File.directory? $ipv6libdir and File.exist? "#{$ipv6libdir}/lib#{$ipv6lib}.a" if File.directory? $ipv6libdir and File.exist? "#{$ipv6libdir}/lib#{$ipv6lib}.a"
$LOCAL_LIBS = " -L#$ipv6libdir -l#$ipv6lib" $LOCAL_LIBS = " -L#$ipv6libdir -l#$ipv6lib"
else elsif !$ipv6trylibc
print <<EOS print <<EOS
Fatal: no #$ipv6lib library found. cannot continue. Fatal: no #$ipv6lib library found. cannot continue.
@ -135,6 +137,23 @@ end
#include <netdb.h> #include <netdb.h>
#include <string.h> #include <string.h>
#include <sys/socket.h> #include <sys/socket.h>
int
main()
{
struct sockaddr_storage ss;
ss.ss_family;
return 0;
}
EOF
$CFLAGS="-DHAVE_SOCKADDR_STORAGE "+$CFLAGS
end
if try_link(<<EOF)
#include <sys/types.h>
#include <netdb.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
int int
main() main()

View file

@ -81,10 +81,27 @@ int Rconnect();
#define INET_SERVER 1 #define INET_SERVER 1
#define INET_SOCKS 2 #define INET_SOCKS 2
#ifndef INET6 #ifndef HAVE_SOCKADDR_STORAGE
# undef ss_family /*
# define sockaddr_storage sockaddr * RFC 2553: protocol-independent placeholder for socket addresses
# define ss_family sa_family */
#define _SS_MAXSIZE 128
#define _SS_ALIGNSIZE (sizeof(long long))
#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(unsigned char) * 2)
#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(unsigned char) * 2 - \
_SS_PAD1SIZE - _SS_ALIGNSIZE)
struct sockaddr_storage {
#ifdef HAVE_SA_LEN
unsigned char ss_len; /* address length */
unsigned char ss_family; /* address family */
#else
unsigned short ss_family;
#endif
char __ss_pad1[_SS_PAD1SIZE];
long long __ss_align; /* force desired structure storage alignment */
char __ss_pad2[_SS_PAD2SIZE];
};
#endif #endif
#ifdef NT #ifdef NT

View file

@ -32,7 +32,7 @@ module Observable
def notify_observers(*arg) def notify_observers(*arg)
if @observer_state if @observer_state
if @observer_peers if @observer_peers
for i in @observer_peers for i in @observer_peers.dup
i.update(*arg) i.update(*arg)
end end
end end

View file

@ -27,7 +27,7 @@ module ParseDate
if date.sub!(/(#{DAYPAT})[a-z]*,?/i, ' ') if date.sub!(/(#{DAYPAT})[a-z]*,?/i, ' ')
wday = DAYS[$1.downcase] wday = DAYS[$1.downcase]
end end
if date.sub!(/(\d+):(\d+)(?::(\d+))?(?:\s*(am|pm))?(?:\s+([a-z]{1,4}(?:\s+[a-z]{1,4}|[-+]\d{4})?))?/i, ' ') if date.sub!(/(\d+):(\d+)(?::(\d+))?(?:\s*(am|pm))?(?:\s+([a-z]{1,4}(?:\s+[a-z]{1,4}|[-+]\d{4})?|[-+]\d{4}))?/i, ' ')
hour = $1.to_i hour = $1.to_i
min = $2.to_i min = $2.to_i
if $3 if $3

View file

@ -180,7 +180,8 @@ The variable ruby-indent-level controls the amount of indentation.
(back-to-indentation) (back-to-indentation)
(setq top (current-column)) (setq top (current-column))
(skip-chars-backward " \t") (skip-chars-backward " \t")
(if (>= shift top) (setq shift (- shift top))) (if (>= shift top) (setq shift (- shift top))
(setq shift 0))
(if (and (bolp) (if (and (bolp)
(= x top)) (= x top))
(move-to-column (+ x shift)) (move-to-column (+ x shift))