* error.c: use HAVE_DECL_SYS_NERR instead of platform names.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b5a8ba178f
commit
20ed1f8d1a
@ -1,3 +1,7 @@
|
|||||||
|
Thu May 2 08:01:56 2002 Chris Thomas <kenshin@apple.com>
|
||||||
|
|
||||||
|
* error.c: use HAVE_DECL_SYS_NERR instead of platform names.
|
||||||
|
|
||||||
Tue Apr 30 09:23:05 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Tue Apr 30 09:23:05 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* numeric.c (num_step): better iteration condition for float
|
* numeric.c (num_step): better iteration condition for float
|
||||||
|
3
config.sub
vendored
3
config.sub
vendored
@ -157,6 +157,9 @@ case $os in
|
|||||||
os=-vxworks
|
os=-vxworks
|
||||||
basic_machine=$1
|
basic_machine=$1
|
||||||
;;
|
;;
|
||||||
|
-hiuxmpp)
|
||||||
|
os=-hiuxmpp
|
||||||
|
;;
|
||||||
-hiux*)
|
-hiux*)
|
||||||
os=-hiuxwe2
|
os=-hiuxwe2
|
||||||
;;
|
;;
|
||||||
|
12
configure.in
12
configure.in
@ -109,6 +109,13 @@ cygwin*|mingw*)
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# by TOYODA Eizi <toyoda@npd.kishou.go.jp>
|
||||||
|
case "$target_os" in
|
||||||
|
hiuxmpp*)
|
||||||
|
AC_DEFINE(__HIUX_MPP__)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
AC_PROG_LN_S
|
AC_PROG_LN_S
|
||||||
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
||||||
|
|
||||||
@ -179,8 +186,10 @@ NORETURN(void exit(int x));],
|
|||||||
done])
|
done])
|
||||||
AC_DEFINE_UNQUOTED([NORETURN(x)], $rb_cv_noreturn)
|
AC_DEFINE_UNQUOTED([NORETURN(x)], $rb_cv_noreturn)
|
||||||
|
|
||||||
|
dnl Check whether we need to define sys_nerr locally
|
||||||
|
AC_CHECK_DECLS([sys_nerr])
|
||||||
|
|
||||||
dnl wheather link libc_r or not
|
dnl whether link libc_r or not
|
||||||
AC_ARG_WITH(libc_r,
|
AC_ARG_WITH(libc_r,
|
||||||
[ --with-libc_r link libc_r if possible (FreeBSD only)], [
|
[ --with-libc_r link libc_r if possible (FreeBSD only)], [
|
||||||
case $withval in
|
case $withval in
|
||||||
@ -712,6 +721,7 @@ if test "$with_dln_a_out" != yes; then
|
|||||||
cygwin*|mingw*) : ${LDSHARED="${CC} -shared -s"}
|
cygwin*|mingw*) : ${LDSHARED="${CC} -shared -s"}
|
||||||
LDFLAGS='-Wl,--stack,0x02000000'
|
LDFLAGS='-Wl,--stack,0x02000000'
|
||||||
rb_cv_dlopen=yes ;;
|
rb_cv_dlopen=yes ;;
|
||||||
|
hiuxmpp) LDSHARED='ld -r' ;;
|
||||||
*) LDSHARED='ld' ;;
|
*) LDSHARED='ld' ;;
|
||||||
esac
|
esac
|
||||||
AC_MSG_RESULT($rb_cv_dlopen)
|
AC_MSG_RESULT($rb_cv_dlopen)
|
||||||
|
2
error.c
2
error.c
@ -513,7 +513,7 @@ static const syserr_index_entry syserr_index[]= {
|
|||||||
static VALUE *syserr_list;
|
static VALUE *syserr_list;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(NT) && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(sys_nerr)
|
#if !HAVE_DECL_SYS_NERR
|
||||||
extern int sys_nerr;
|
extern int sys_nerr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
4
io.c
4
io.c
@ -73,8 +73,8 @@ struct timeval {
|
|||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
/* EMX has sys/parm.h, but.. */
|
/* EMX has sys/param.h, but.. */
|
||||||
#if defined(HAVE_SYS_PARAM_H) && !defined(__EMX__)
|
#if defined(HAVE_SYS_PARAM_H) && !(defined(__EMX__) || defined(__HIUX_MPP__))
|
||||||
# include <sys/param.h>
|
# include <sys/param.h>
|
||||||
#else
|
#else
|
||||||
# define NOFILE 64
|
# define NOFILE 64
|
||||||
|
@ -788,7 +788,6 @@ num_step(argc, argv, from)
|
|||||||
while (i <= end) {
|
while (i <= end) {
|
||||||
rb_yield(INT2FIX(i));
|
rb_yield(INT2FIX(i));
|
||||||
i += diff;
|
i += diff;
|
||||||
printf("<<%g>>\n", i - end);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
31
range.c
31
range.c
@ -265,26 +265,17 @@ range_step(argc, argv, range)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (FIXNUM_P(b) && FIXNUM_P(e)) { /* fixnums are special */
|
if (FIXNUM_P(b) && FIXNUM_P(e)) { /* fixnums are special */
|
||||||
long beg = FIX2LONG(b), end = FIX2LONG(e), s = NUM2LONG(step);
|
long beg, end = FIX2LONG(e), s = NUM2LONG(step);
|
||||||
long i;
|
long i;
|
||||||
if (s <= 0) {
|
if (s <= 0) {
|
||||||
rb_raise(rb_eArgError, "step can't be <= 0");
|
rb_raise(rb_eArgError, "step can't be <= 0");
|
||||||
}
|
}
|
||||||
if ((end - beg) < 0) {
|
|
||||||
if (!EXCL(range)) end -= 1;
|
|
||||||
for (i=beg; i>end; i-=s) {
|
|
||||||
rb_yield(LONG2NUM(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (!EXCL(range)) end += 1;
|
if (!EXCL(range)) end += 1;
|
||||||
for (i=beg; i<end; i+=s) {
|
for (i=FIX2LONG(b); i<end; i+=s) {
|
||||||
rb_yield(INT2NUM(i));
|
rb_yield(INT2NUM(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (rb_obj_is_kind_of(b, rb_cNumeric)) {
|
else if (rb_obj_is_kind_of(b, rb_cNumeric)) {
|
||||||
VALUE diff;
|
|
||||||
b = rb_Integer(b);
|
b = rb_Integer(b);
|
||||||
e = rb_Integer(e);
|
e = rb_Integer(e);
|
||||||
step = rb_Integer(step);
|
step = rb_Integer(step);
|
||||||
@ -292,36 +283,32 @@ range_step(argc, argv, range)
|
|||||||
if (RTEST(rb_funcall(step, rb_intern("<="), 1, INT2FIX(0)))) {
|
if (RTEST(rb_funcall(step, rb_intern("<="), 1, INT2FIX(0)))) {
|
||||||
rb_raise(rb_eArgError, "step can't be <= 0");
|
rb_raise(rb_eArgError, "step can't be <= 0");
|
||||||
}
|
}
|
||||||
diff = rb_funcall(e, '-', 1, b);
|
|
||||||
if (RTEST(rb_funcall(diff, '<', 1, INT2FIX(0)))) {
|
|
||||||
if (!EXCL(range)) e = rb_funcall(e, '-', 1, INT2FIX(1));
|
|
||||||
while (RTEST(rb_funcall(b, '>', 1, e))) {
|
|
||||||
rb_yield(b);
|
|
||||||
b = rb_funcall(b, '-', 1, step);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (!EXCL(range)) e = rb_funcall(e, '+', 1, INT2FIX(1));
|
if (!EXCL(range)) e = rb_funcall(e, '+', 1, INT2FIX(1));
|
||||||
while (RTEST(rb_funcall(b, '<', 1, e))) {
|
while (RTEST(rb_funcall(b, '<', 1, e))) {
|
||||||
rb_yield(b);
|
rb_yield(b);
|
||||||
b = rb_funcall(b, '+', 1, step);
|
b = rb_funcall(b, '+', 1, step);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (TYPE(b) == T_STRING) {
|
else if (TYPE(b) == T_STRING) {
|
||||||
VALUE args[5];
|
VALUE args[5];
|
||||||
long iter[2];
|
long iter[2];
|
||||||
|
|
||||||
args[0] = b; args[1] = e; args[2] = range;
|
args[0] = b; args[1] = e; args[2] = range;
|
||||||
iter[0] = 1; iter[1] = NUM2LONG(step);
|
iter[0] = 1; iter[1] = NUM2LONG(step);
|
||||||
|
if (iter[1] <= 0) {
|
||||||
|
rb_raise(rb_eArgError, "step can't be <= 0");
|
||||||
|
}
|
||||||
rb_iterate((VALUE(*)_((VALUE)))r_step_str, (VALUE)args, r_step_str_i,
|
rb_iterate((VALUE(*)_((VALUE)))r_step_str, (VALUE)args, r_step_str_i,
|
||||||
(VALUE)iter);
|
(VALUE)iter);
|
||||||
}
|
}
|
||||||
else { /* generic each */
|
else { /* generic each */
|
||||||
VALUE v = b;
|
VALUE v = b;
|
||||||
long lim = NUM2INT(step);
|
long lim = NUM2LONG(step);
|
||||||
long i;
|
long i;
|
||||||
|
|
||||||
|
if (lim <= 0) {
|
||||||
|
rb_raise(rb_eArgError, "step can't be <= 0");
|
||||||
|
}
|
||||||
if (EXCL(range)) {
|
if (EXCL(range)) {
|
||||||
while (r_lt(v, e)) {
|
while (r_lt(v, e)) {
|
||||||
if (r_eq(v, e)) break;
|
if (r_eq(v, e)) break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user