diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-05-18 09:12:27 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-05-18 09:12:27 +0000 |
commit | f9c63857f83cbd427b0b0e57f28c20b1322f78ae (patch) | |
tree | 26789ad88816aa387f774836b31222d0b40da4e4 | |
parent | 41c6972dd515d42a321ce0dbd329b1aec5fe5185 (diff) |
BeOS patches
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | configure | 2 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | error.c | 21 | ||||
-rw-r--r-- | ext/extmk.rb.in | 4 | ||||
-rw-r--r-- | ext/socket/extconf.rb | 5 | ||||
-rw-r--r-- | ext/socket/socket.c | 6 | ||||
-rw-r--r-- | glob.c | 6 | ||||
-rw-r--r-- | sprintf.c | 1 | ||||
-rw-r--r-- | string.c | 2 |
10 files changed, 52 insertions, 11 deletions
@@ -1,5 +1,17 @@ -Mon May 18 14:52:21 1998 Yukihiro Matsumoto <[email protected]> +Mon May 18 16:40:50 1998 MAEDA shugo <[email protected]> + + * error.c (get_syserr): BeOS support. + + * configure.in: modified for BeOS. + + * string.c (str_dump): do not call isascii(). + * sprintf.c (remove_sign_bits): forgot to initialize end pointer. + + * glob.c: #include <alloca.h> added. + +Mon May 18 14:52:21 1998 Yukihiro Matsumoto <[email protected]> + * experimental release 1.1b9_21. Mon May 18 03:27:57 1998 MAEDA shugo <[email protected]> @@ -3481,7 +3481,7 @@ echo "configure:3435: checking whether OS depend dynamic link works" >&5 LDSHARED='' LDFLAGS='' ;; beos*) LDSHARED="mwld -xms" - DLDFLAGS="-f ruby.exp" + DLDFLAGS="" rb_cv_dlopen=yes ;; *) LDSHARED='ld' ;; esac diff --git a/configure.in b/configure.in index edc76766e2..7939da9498 100644 --- a/configure.in +++ b/configure.in @@ -359,7 +359,7 @@ if test "$with_dln_a_out" != yes; then LDSHARED='' LDFLAGS='' ;; beos*) LDSHARED="mwld -xms" - DLDFLAGS="-f ruby.exp" + DLDFLAGS="" rb_cv_dlopen=yes ;; *) LDSHARED='ld' ;; esac @@ -507,6 +507,27 @@ syserr_errno(self) 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 diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in index a788030eb2..fabfc4443b 100644 --- a/ext/extmk.rb.in +++ b/ext/extmk.rb.in @@ -355,7 +355,7 @@ def extmake(target) 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 @@ if $extlist.size > 0 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) diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb index 80bd74338c..dbba2cacf3 100644 --- a/ext/socket/extconf.rb +++ b/ext/socket/extconf.rb @@ -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") diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 07de964188..39b4efa34e 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -1167,7 +1167,7 @@ static VALUE 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 @@ sock_s_gethostbyaddr(argc, argv) 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 { @@ -25,6 +25,10 @@ #pragma alloca #endif /* _AIX && RISC6000 && !__GNUC__ */ +#if defined (HAVE_ALLOCA_H) +# include <alloca.h> +#endif + #if defined (HAVE_UNISTD_H) # include <unistd.h> #endif @@ -72,7 +76,7 @@ # include <strings.h> #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 */ @@ -23,6 +23,7 @@ remove_sign_bits(str, base) char *s, *t, *end; s = t = str; + end = str + strlen(str); if (base == 16) { x_retry: @@ -1512,7 +1512,7 @@ str_dump(str) *q++ = '\\'; *q++ = c; } - else if (isascii(c) && isprint(c)) { + else if (ISPRINT(c)) { *q++ = c; } else if (c == '\n') { |