From: MAEDA Shugo Date: 1998-05-18T17:49:01+09:00 Subject: [ruby-dev:2676] Re: experimental release 1.1b9_21 前田です。 matz@netlab.co.jp (Yukihiro Matsumoto) wrote: >出ました.1.1b9_20の細かいバグ修正版です. すみません、BeOS関連でまた問題がいくつか見付かりました。 あと、sprintf.cとsocket.cでバグらしき物をみつけました。 やっと製品版のコンパイラが届いたので、バイナリパッケージを 作ってin.comingにputしようと思います。 PPC/Intelでシンボルのexportの仕方が違うために、まだ拡張 モジュールのダイナミックリンクには対応していないのですが、 このあたりはどうしましょう>藤本さん。 -- 前田 修吾 --- configure.orig Mon May 18 16:40:37 1998 +++ configure Mon May 18 16:40:50 1998 @@ -3481,7 +3481,7 @@ LDSHARED='' LDFLAGS='' ;; beos*) LDSHARED="mwld -xms" - DLDFLAGS="-f ruby.exp" + DLDFLAGS="" rb_cv_dlopen=yes ;; *) LDSHARED='ld' ;; esac --- configure.in.orig Mon May 18 16:38:42 1998 +++ configure.in Mon May 18 16:38:59 1998 @@ -359,7 +359,7 @@ LDSHARED='' LDFLAGS='' ;; beos*) LDSHARED="mwld -xms" - DLDFLAGS="-f ruby.exp" + DLDFLAGS="" rb_cv_dlopen=yes ;; *) LDSHARED='ld' ;; esac --- error.c.orig Mon May 18 15:58:44 1998 +++ error.c Mon May 18 15:58:48 1998 @@ -507,6 +507,27 @@ return rb_iv_get(self, "errno"); } +#ifdef __BEOS__ +static VALUE +get_syserr(int i) +{ + VALUE *list; + int ix, offset; + + i -= B_GENERAL_ERROR_BASE; + ix = (i >> 12) & 0xf; + offset = (i >> 8) & 0xf; + if (offset < syserr_index[ix].n) { + ix = syserr_index[ix].ix; + if ((i & 0xff) < syserr_list[ix + offset].n) { + list = syserr_list[ix + offset].list; + return list[i & 0xff]; + } + } + return 0; +} +#endif /* __BEOS__ */ + static void init_syserr _((void)); void --- glob.c.orig Mon May 18 16:00:05 1998 +++ glob.c Mon May 18 16:00:46 1998 @@ -25,6 +25,10 @@ #pragma alloca #endif /* _AIX && RISC6000 && !__GNUC__ */ +#if defined (HAVE_ALLOCA_H) +# include +#endif + #if defined (HAVE_UNISTD_H) # include #endif @@ -72,7 +76,7 @@ # include #endif /* !HAVE_STRING_H */ -#if !defined (HAVE_BCOPY) +#if !defined (HAVE_BCOPY) && !defined (bcopy) # define bcopy(s, d, n) ((void) memcpy ((d), (s), (n))) #endif /* !HAVE_BCOPY */ --- sprintf.c.orig Mon May 18 16:01:16 1998 +++ sprintf.c Mon May 18 16:02:04 1998 @@ -23,6 +23,7 @@ char *s, *t, *end; s = t = str; + end = str + strlen(str); if (base == 16) { x_retry: --- string.c.orig Mon May 18 16:10:28 1998 +++ string.c Mon May 18 16:13:19 1998 @@ -18,6 +18,10 @@ #include +#ifndef isascii +#define isascii(c) (((c) & ~0x7f) == 0) +#endif + #ifdef HAVE_UNISTD_H #include #endif --- ext/extmk.rb.in.orig Mon May 18 16:33:13 1998 +++ ext/extmk.rb.in Mon May 18 16:34:06 1998 @@ -355,7 +355,7 @@ return if $nodynamic and not $static $objs = nil - $libs = PLATFORM =~ /cygwin32/ ? nil : "-lc" + $libs = PLATFORM =~ /cygwin32|beos/ ? nil : "-lc" $local_libs = nil # to be assigned in extconf.rb $CFLAGS = nil $LDFLAGS = nil @@ -485,7 +485,7 @@ end $extobjs = "ext/extinit.o " + $extobjs - if PLATFORM == "m68k-human" + if PLATFORM =~ /m68k-human|beos/ $extlibs.gsub!("-L/usr/local/lib", "") if $extlibs end system format('make ruby@binsuffix@ EXTOBJS="%s" EXTLIBS="%s"', $extobjs, $extlibs) --- ext/socket/extconf.rb.orig Mon May 18 16:47:29 1998 +++ ext/socket/extconf.rb Mon May 18 17:30:15 1998 @@ -1,11 +1,14 @@ require 'mkmf' -$LDFLAGS = "-L/usr/local/lib" +$LDFLAGS = "-L/usr/local/lib" if File.directory?("/usr/local/lib") case PLATFORM when /mswin32/ test_func = "WSACleanup" have_library("wsock32", "WSACleanup") when /cygwin32/ test_func = "socket" +when /beos/ + test_func = "socket" + have_library("net", "socket") else test_func = "socket" have_library("socket", "socket") --- ext/socket/socket.c.orig Mon May 18 17:05:44 1998 +++ ext/socket/socket.c Mon May 18 17:17:01 1998 @@ -1167,7 +1167,7 @@ sock_s_socketpair(class, domain, type, protocol) VALUE class, domain, type, protocol; { -#if !defined(NT) +#if !defined(NT) && !defined(__BEOS__) int fd; int d, t, sp[2]; @@ -1368,9 +1368,9 @@ struct sockaddr_in *addr; struct hostent *h; - rb_scan_args(argc, argv, "11", &addr, &type); + rb_scan_args(argc, argv, "11", &addr, &vtype); Check_Type(addr, T_STRING); - if (!NIL_P(type)) { + if (!NIL_P(vtype)) { type = NUM2INT(vtype); } else {