summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-05-18 09:12:27 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-05-18 09:12:27 +0000
commitf9c63857f83cbd427b0b0e57f28c20b1322f78ae (patch)
tree26789ad88816aa387f774836b31222d0b40da4e4
parent41c6972dd515d42a321ce0dbd329b1aec5fe5185 (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--ChangeLog14
-rw-r--r--configure2
-rw-r--r--configure.in2
-rw-r--r--error.c21
-rw-r--r--ext/extmk.rb.in4
-rw-r--r--ext/socket/extconf.rb5
-rw-r--r--ext/socket/socket.c6
-rw-r--r--glob.c6
-rw-r--r--sprintf.c1
-rw-r--r--string.c2
10 files changed, 52 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index be6423998e..d4e4719c57 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
-Mon May 18 14:52:21 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
+Mon May 18 16:40:50 1998 MAEDA shugo <shugo@aianet.ne.jp>
+
+ * 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 <matz@netlab.co.jp>
+
* experimental release 1.1b9_21.
Mon May 18 03:27:57 1998 MAEDA shugo <shugo@aianet.ne.jp>
diff --git a/configure b/configure
index de201811c6..6426f46d26 100644
--- a/configure
+++ b/configure
@@ -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
diff --git a/error.c b/error.c
index 9c024dddd8..d8a96e5080 100644
--- a/error.c
+++ b/error.c
@@ -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 {
diff --git a/glob.c b/glob.c
index 33051214df..bba41e6687 100644
--- a/glob.c
+++ b/glob.c
@@ -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 */
diff --git a/sprintf.c b/sprintf.c
index 27103f96d2..bc7f77bfb6 100644
--- a/sprintf.c
+++ b/sprintf.c
@@ -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:
diff --git a/string.c b/string.c
index 1fb6e4da4d..f0c05de19b 100644
--- a/string.c
+++ b/string.c
@@ -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') {