summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-05-13 07:26:47 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-05-13 07:26:47 +0000
commitae2fe781dd4aae16a2f03a4b9fb93514eb9886d4 (patch)
treebc7b2f6399af854b2b7e3515916c5f51d970bf57
parentad592443af373c3bbe61b41df106734856ad3072 (diff)
1.1b9_19
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--array.c12
-rw-r--r--bignum.c12
-rw-r--r--class.c16
-rw-r--r--config.guess9
-rw-r--r--config.sub3
-rw-r--r--configure387
-rw-r--r--configure.in14
-rw-r--r--defines.h2
-rw-r--r--dir.c12
-rw-r--r--dln.c113
-rw-r--r--enum.c1
-rw-r--r--error.c222
-rw-r--r--eval.c53
-rw-r--r--ext/dbm/dbm.c5
-rw-r--r--ext/etc/etc.c2
-rw-r--r--ext/md5/md5init.c3
-rw-r--r--ext/socket/socket.c37
-rw-r--r--ext/tcltklib/tcltklib.c20
-rw-r--r--file.c28
-rw-r--r--fnmatch.c4
-rw-r--r--gc.c3
-rw-r--r--glob.c2
-rw-r--r--hash.c11
-rw-r--r--intern.h27
-rw-r--r--io.c50
-rw-r--r--marshal.c4
-rw-r--r--numeric.c5
-rw-r--r--object.c6
-rw-r--r--parse.y1
-rw-r--r--process.c43
-rw-r--r--range.c4
-rw-r--r--regex.c4
-rw-r--r--ruby.c18
-rw-r--r--ruby.h88
-rw-r--r--signal.c41
-rw-r--r--st.c4
-rw-r--r--string.c2
-rw-r--r--struct.c22
-rw-r--r--time.c5
-rw-r--r--variable.c10
-rw-r--r--version.h4
42 files changed, 952 insertions, 363 deletions
diff --git a/ChangeLog b/ChangeLog
index 4d4e952..6b897d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
Wed May 13 14:56:23 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
+ * experimental release 1.1b9_19.
+
+ * most of the Mac and BeOS patches merged, except path separators.
+
+ * error.c (err_append): generated SyntaxError was String.
+
* ruby.h: xxx2INT, xxx2UINT checks values as int, not long.
* ruby.h: remove typedef's. INT, UINT, UCHAR, USHORT.
diff --git a/array.c b/array.c
index 529c936..61b6344 100644
--- a/array.c
+++ b/array.c
@@ -81,12 +81,22 @@ ary_new()
return ary_new2(ARY_DEFAULT_SIZE);
}
+#ifdef __STDC__
+#include <stdarg.h>
+#define va_init_list(a,b) va_start(a,b)
+#else
#include <varargs.h>
+#define va_init_list(a,b) va_start(a)
+#endif
VALUE
+#ifdef __STDC__
+ary_new3(int n, ...)
+#else
ary_new3(n, va_alist)
int n;
va_dcl
+#endif
{
va_list ar;
VALUE ary;
@@ -97,7 +107,7 @@ ary_new3(n, va_alist)
}
ary = ary_new2(n<ARY_DEFAULT_SIZE?ARY_DEFAULT_SIZE:n);
- va_start(ar);
+ va_init_list(ar, n);
for (i=0; i<n; i++) {
RARRAY(ary)->ptr[i] = va_arg(ar, VALUE);
}
diff --git a/bignum.c b/bignum.c
index bd14002..cce2327 100644
--- a/bignum.c
+++ b/bignum.c
@@ -558,6 +558,18 @@ bigadd(x, y, sign)
if (RBIGNUM(y)->sign == sign) return bigsub(y, x);
return bigsub(x, y);
}
+ else if (sign == 0) {
+ /* x - y */
+ if ((RBIGNUM(x)->sign == 0) && (RBIGNUM(y)->sign == 1)) {
+ /* x is negative and y is positive. */
+ /* return -(abs(x) + y) */
+ VALUE ret;
+ RBIGNUM(x)->sign = 1; /* x = abs(x) */
+ ret = bigadd(x, y, 1); /* ret = x + y (recursive call) */
+ RBIGNUM(ret)->sign = 0; /* ret = -ret */
+ return ret;
+ }
+ }
if (RBIGNUM(x)->len > RBIGNUM(y)->len) {
len = RBIGNUM(x)->len + 1;
diff --git a/class.c b/class.c
index 1f8bccc..14f4c0b 100644
--- a/class.c
+++ b/class.c
@@ -14,6 +14,10 @@
#include "node.h"
#include "st.h"
+#ifdef USE_CWGUSI
+#include <stdio.h>
+#endif
+
struct st_table *new_idhash();
extern st_table *rb_class_tbl;
@@ -561,22 +565,32 @@ rb_define_attr(klass, name, read, write)
rb_attr(klass, rb_intern(name), read, write, FALSE);
}
+#ifdef __STDC__
+#include <stdarg.h>
+#define va_init_list(a,b) va_start(a,b)
+#else
#include <varargs.h>
+#define va_init_list(a,b) va_start(a)
+#endif
#include <ctype.h>
int
+#ifdef __STDC__
+rb_scan_args(int argc, VALUE *argv, char *fmt, ...)
+#else
rb_scan_args(argc, argv, fmt, va_alist)
int argc;
VALUE *argv;
char *fmt;
va_dcl
+#endif
{
int n, i;
char *p = fmt;
VALUE *var;
va_list vargs;
- va_start(vargs);
+ va_init_list(vargs, fmt);
if (*p == '*') {
var = va_arg(vargs, VALUE*);
diff --git a/config.guess b/config.guess
index cb7bb28..2b0a739 100644
--- a/config.guess
+++ b/config.guess
@@ -728,6 +728,15 @@ EOF
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
+ DS/90*:*:*:V20*)
+ echo sparc-fujitsu-uxpds
+ exit 0 ;;
+ BeBox:BeOS:*:*)
+ echo powerpc-be-beos
+ exit 0 ;;
+ BeMac:BeOS:*:*)
+ echo powerpc-apple-beos
+ exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
diff --git a/config.sub b/config.sub
index d378103..86328ef 100644
--- a/config.sub
+++ b/config.sub
@@ -783,6 +783,9 @@ case $os in
;;
-human)
;;
+ -beos)
+ os=-beos
+ ;;
-none)
;;
*)
diff --git a/configure b/configure
index afd3fac..0d01763 100644
--- a/configure
+++ b/configure
@@ -1186,10 +1186,11 @@ fi
case "$host_os" in
nextstep*) ;;
human*) ;;
+beos*) ;;
*) LIBS="-lm $LIBS";;
esac
echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:1193: checking for crypt in -lcrypt" >&5
+echo "configure:1194: checking for crypt in -lcrypt" >&5
ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1197,7 +1198,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcrypt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1201 "configure"
+#line 1202 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1208,7 +1209,7 @@ int main() {
crypt()
; return 0; }
EOF
-if { (eval echo configure:1212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1236,7 +1237,7 @@ else
fi
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:1240: checking for dlopen in -ldl" >&5
+echo "configure:1241: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1244,7 +1245,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1248 "configure"
+#line 1249 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1255,7 +1256,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:1259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1283,7 +1284,7 @@ else
fi
# Dynamic linking for SunOS/Solaris and SYSV
echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:1287: checking for shl_load in -ldld" >&5
+echo "configure:1288: checking for shl_load in -ldld" >&5
ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1291,7 +1292,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldld $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1295 "configure"
+#line 1296 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1302,7 +1303,7 @@ int main() {
shl_load()
; return 0; }
EOF
-if { (eval echo configure:1306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1335,12 +1336,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:1339: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1340: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1344 "configure"
+#line 1345 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -1348,7 +1349,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:1352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1353: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -1373,7 +1374,7 @@ done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:1377: checking for opendir in -ldir" >&5
+echo "configure:1378: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1381,7 +1382,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1385 "configure"
+#line 1386 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1392,7 +1393,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:1396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1414,7 +1415,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1418: checking for opendir in -lx" >&5
+echo "configure:1419: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1422,7 +1423,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1426 "configure"
+#line 1427 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1433,7 +1434,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:1437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1456,12 +1457,12 @@ fi
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1460: checking for ANSI C header files" >&5
+echo "configure:1461: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1465 "configure"
+#line 1466 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1469,7 +1470,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1473: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1474: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1486,7 +1487,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1490 "configure"
+#line 1491 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1504,7 +1505,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1508 "configure"
+#line 1509 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1525,7 +1526,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1529 "configure"
+#line 1530 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1536,7 +1537,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1561,21 +1562,22 @@ fi
for ac_hdr in stdlib.h unistd.h limits.h sys/file.h sys/ioctl.h pwd.h \
sys/select.h sys/time.h sys/times.h sys/param.h sys/wait.h\
- syscall.h a.out.h string.h utime.h memory.h
+ syscall.h a.out.h string.h utime.h memory.h\
+ varargs.h stdarg.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1569: checking for $ac_hdr" >&5
+echo "configure:1571: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1574 "configure"
+#line 1576 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1579: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1581: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1603,12 +1605,12 @@ done
echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:1607: checking for uid_t in sys/types.h" >&5
+echo "configure:1609: checking for uid_t in sys/types.h" >&5
if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1612 "configure"
+#line 1614 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -1637,12 +1639,12 @@ EOF
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1641: checking for size_t" >&5
+echo "configure:1643: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1646 "configure"
+#line 1648 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1670,12 +1672,12 @@ EOF
fi
echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
-echo "configure:1674: checking for st_blksize in struct stat" >&5
+echo "configure:1676: checking for st_blksize in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1679 "configure"
+#line 1681 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -1683,7 +1685,7 @@ int main() {
struct stat s; s.st_blksize;
; return 0; }
EOF
-if { (eval echo configure:1687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blksize=yes
else
@@ -1705,12 +1707,12 @@ fi
save_LIBOJBS="$LIBOBJS"
echo $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6
-echo "configure:1709: checking for st_blocks in struct stat" >&5
+echo "configure:1711: checking for st_blocks in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1714 "configure"
+#line 1716 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -1718,7 +1720,7 @@ int main() {
struct stat s; s.st_blocks;
; return 0; }
EOF
-if { (eval echo configure:1722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_blocks=yes
else
@@ -1742,12 +1744,12 @@ fi
LIBOBJS="$save_LIBOBJS"
echo $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6
-echo "configure:1746: checking for st_rdev in struct stat" >&5
+echo "configure:1748: checking for st_rdev in struct stat" >&5
if eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1751 "configure"
+#line 1753 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -1755,7 +1757,7 @@ int main() {
struct stat s; s.st_rdev;
; return 0; }
EOF
-if { (eval echo configure:1759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_st_rdev=yes
else
@@ -1776,47 +1778,8 @@ EOF
fi
-echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:1781: checking size of short" >&5
-if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- if test "$cross_compiling" = yes; then
- { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
-else
- cat > conftest.$ac_ext <<EOF
-#line 1789 "configure"
-#include "confdefs.h"
-#include <stdio.h>
-main()
-{
- FILE *f=fopen("conftestval", "w");
- if (!f) exit(1);
- fprintf(f, "%d\n", sizeof(short));
- exit(0);
-}
-EOF
-if { (eval echo configure:1800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
-then
- ac_cv_sizeof_short=`cat conftestval`
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_sizeof_short=0
-fi
-rm -fr conftest*
-fi
-
-fi
-echo "$ac_t""$ac_cv_sizeof_short" 1>&6
-cat >> confdefs.h <<EOF
-#define SIZEOF_SHORT $ac_cv_sizeof_short
-EOF
-
-
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:1820: checking size of int" >&5
+echo "configure:1783: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1824,7 +1787,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1828 "configure"
+#line 1791 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1835,7 +1798,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_int=`cat conftestval`
else
@@ -1855,7 +1818,7 @@ EOF
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:1859: checking size of long" >&5
+echo "configure:1822: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1863,7 +1826,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1867 "configure"
+#line 1830 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1874,7 +1837,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_long=`cat conftestval`
else
@@ -1894,7 +1857,7 @@ EOF
echo $ac_n "checking size of void*""... $ac_c" 1>&6
-echo "configure:1898: checking size of void*" >&5
+echo "configure:1861: checking size of void*" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_voidp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1902,7 +1865,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1906 "configure"
+#line 1869 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -1913,7 +1876,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:1917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_voidp=`cat conftestval`
else
@@ -1934,7 +1897,7 @@ EOF
echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:1938: checking type of array argument to getgroups" >&5
+echo "configure:1901: checking type of array argument to getgroups" >&5
if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1942,7 +1905,7 @@ else
ac_cv_type_getgroups=cross
else
cat > conftest.$ac_ext <<EOF
-#line 1946 "configure"
+#line 1909 "configure"
#include "confdefs.h"
/* Thanks to Mike Rendell for this test. */
@@ -1967,7 +1930,7 @@ main()
}
EOF
-if { (eval echo configure:1971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_type_getgroups=gid_t
else
@@ -1981,7 +1944,7 @@ fi
if test $ac_cv_type_getgroups = cross; then
cat > conftest.$ac_ext <<EOF
-#line 1985 "configure"
+#line 1948 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -2005,12 +1968,12 @@ EOF
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2009: checking return type of signal handlers" >&5
+echo "configure:1972: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2014 "configure"
+#line 1977 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -2027,7 +1990,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:2031: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -2048,19 +2011,19 @@ EOF
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:2052: checking for working alloca.h" >&5
+echo "configure:2015: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2057 "configure"
+#line 2020 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:2064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -2081,12 +2044,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2085: checking for alloca" >&5
+echo "configure:2048: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2090 "configure"
+#line 2053 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -2109,7 +2072,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:2113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -2141,12 +2104,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:2145: checking whether alloca needs Cray hooks" >&5
+echo "configure:2108: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2150 "configure"
+#line 2113 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -2171,12 +2134,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2175: checking for $ac_func" >&5
+echo "configure:2138: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2180 "configure"
+#line 2143 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2199,7 +2162,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2226,7 +2189,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:2230: checking stack direction for C alloca" >&5
+echo "configure:2193: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2234,7 +2197,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 2238 "configure"
+#line 2201 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -2253,7 +2216,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:2257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -2275,12 +2238,12 @@ EOF
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:2279: checking for pid_t" >&5
+echo "configure:2242: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2284 "configure"
+#line 2247 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2309,17 +2272,17 @@ fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:2313: checking for vfork.h" >&5
+echo "configure:2276: checking for vfork.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2318 "configure"
+#line 2281 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2286: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2344,18 +2307,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:2348: checking for working vfork" >&5
+echo "configure:2311: checking for working vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$cross_compiling" = yes; then
echo $ac_n "checking for vfork""... $ac_c" 1>&6
-echo "configure:2354: checking for vfork" >&5
+echo "configure:2317: checking for vfork" >&5
if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2359 "configure"
+#line 2322 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -2378,7 +2341,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:2382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_vfork=yes"
else
@@ -2399,7 +2362,7 @@ fi
else
cat > conftest.$ac_ext <<EOF
-#line 2403 "configure"
+#line 2366 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -2494,7 +2457,7 @@ main() {
}
}
EOF
-if { (eval echo configure:2498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_func_vfork_works=yes
else
@@ -2517,7 +2480,7 @@ EOF
fi
echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
-echo "configure:2521: checking for 8-bit clean memcmp" >&5
+echo "configure:2484: checking for 8-bit clean memcmp" >&5
if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2525,7 +2488,7 @@ else
ac_cv_func_memcmp_clean=no
else
cat > conftest.$ac_ext <<EOF
-#line 2529 "configure"
+#line 2492 "configure"
#include "confdefs.h"
main()
@@ -2535,7 +2498,7 @@ main()
}
EOF
-if { (eval echo configure:2539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_func_memcmp_clean=yes
else
@@ -2556,12 +2519,12 @@ for ac_func in dup2 setenv memmove mkdir strcasecmp strerror strftime\
strchr strstr strtoul strdup crypt flock
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2560: checking for $ac_func" >&5
+echo "configure:2523: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2565 "configure"
+#line 2528 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2584,7 +2547,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2614,15 +2577,15 @@ for ac_func in fmod killpg random wait4 waitpid syscall getcwd\
truncate chsize times utimes fcntl lockf setitimer\
setruid seteuid setreuid setrgid setegid setregid\
setpgrp2 getpgid getgroups getpriority\
- dlopen sigprocmask sigaction _setjmp
+ dlopen sigprocmask sigaction _setjmp setpgrp
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2621: checking for $ac_func" >&5
+echo "configure:2584: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2626 "configure"
+#line 2589 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2645,7 +2608,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2671,12 +2634,12 @@ done
if test "$ac_cv_func_strftime" = no; then
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:2675: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:2638: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2680 "configure"
+#line 2643 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@@ -2684,7 +2647,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:2688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
@@ -2705,12 +2668,12 @@ EOF
fi
echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:2709: checking for tm_zone in struct tm" >&5
+echo "configure:2672: checking for tm_zone in struct tm" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2714 "configure"
+#line 2677 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
@@ -2718,7 +2681,7 @@ int main() {
struct tm tm; tm.tm_zone;
; return 0; }
EOF
-if { (eval echo configure:2722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm_zone=yes
else
@@ -2738,12 +2701,12 @@ EOF
else
echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:2742: checking for tzname" >&5
+echo "configure:2705: checking for tzname" >&5
if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2747 "configure"
+#line 2710 "configure"
#include "confdefs.h"
#include <time.h>
#ifndef tzname /* For SGI. */
@@ -2753,7 +2716,7 @@ int main() {
atoi(*tzname);
; return 0; }
EOF
-if { (eval echo configure:2757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_var_tzname=yes
else
@@ -2775,14 +2738,14 @@ EOF
fi
cat > conftest.$ac_ext <<EOF
-#line 2779 "configure"
+#line 2742 "configure"
#include "confdefs.h"
int main() {
extern int daylight; int i = daylight;
; return 0; }
EOF
-if { (eval echo configure:2786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_DAYLIGHT 1
@@ -2802,7 +2765,7 @@ EOF
else
echo $ac_n "checking for BSD signal semantics""... $ac_c" 1>&6
-echo "configure:2806: checking for BSD signal semantics" >&5
+echo "configure:2769: checking for BSD signal semantics" >&5
if eval "test \"`echo '$''{'rb_cv_bsd_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2810,7 +2773,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2814 "configure"
+#line 2777 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2832,7 +2795,7 @@ main()
}
EOF
-if { (eval echo configure:2836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
rb_cv_bsd_signal=yes
else
@@ -2866,19 +2829,19 @@ EOF
else
echo $ac_n "checking whether getpgrp() has arg""... $ac_c" 1>&6
-echo "configure:2870: checking whether getpgrp() has arg" >&5
+echo "configure:2833: checking whether getpgrp() has arg" >&5
if eval "test \"`echo '$''{'rb_cv_bsdgetpgrp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2875 "configure"
+#line 2838 "configure"
#include "confdefs.h"
#include <unistd.h>
int main() {
getpgrp(0);
; return 0; }
EOF
-if { (eval echo configure:2882: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_bsdgetpgrp=yes
else
@@ -2899,19 +2862,19 @@ EOF
fi
echo $ac_n "checking whether setpgrp() has args""... $ac_c" 1>&6
-echo "configure:2903: checking whether setpgrp() has args" >&5
+echo "configure:2866: checking whether setpgrp() has args" >&5
if eval "test \"`echo '$''{'rb_cv_bsdsetpgrp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2908 "configure"
+#line 2871 "configure"
#include "confdefs.h"
#include <unistd.h>
int main() {
setpgrp(1, 1);
; return 0; }
EOF
-if { (eval echo configure:2915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2878: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_bsdsetpgrp=yes
else
@@ -2933,14 +2896,14 @@ EOF
fi
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:2937: checking whether byte ordering is bigendian" >&5
+echo "configure:2900: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF
-#line 2944 "configure"
+#line 2907 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -2951,11 +2914,11 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:2955: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2918: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
# It does; now see whether it defined to BIG_ENDIAN or not.
cat > conftest.$ac_ext <<EOF
-#line 2959 "configure"
+#line 2922 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -2966,7 +2929,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:2970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@@ -2986,7 +2949,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2990 "configure"
+#line 2953 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@@ -2999,7 +2962,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:3003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_bigendian=no
else
@@ -3023,14 +2986,14 @@ EOF
fi
echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
-echo "configure:3027: checking whether char is unsigned" >&5
+echo "configure:2990: checking whether char is unsigned" >&5
if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$GCC" = yes; then
# GCC predefines this symbol on systems where it applies.
cat > conftest.$ac_ext <<EOF
-#line 3034 "configure"
+#line 2997 "configure"
#include "confdefs.h"
#ifdef __CHAR_UNSIGNED__
yes
@@ -3052,7 +3015,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3056 "configure"
+#line 3019 "configure"
#include "confdefs.h"
/* volatile prevents gcc2 from optimizing the test away on sparcs. */
#if !defined(__STDC__) || __STDC__ != 1
@@ -3062,7 +3025,7 @@ main() {
volatile char c = 255; exit(c < 0);
}
EOF
-if { (eval echo configure:3066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_char_unsigned=yes
else
@@ -3087,19 +3050,19 @@ fi
echo $ac_n "checking count field in FILE structures""... $ac_c" 1>&6
-echo "configure:3091: checking count field in FILE structures" >&5
+echo "configure:3054: checking count field in FILE structures" >&5
if eval "test \"`echo '$''{'rb_cv_fcnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3096 "configure"
+#line 3059 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_cnt = 0;
; return 0; }
EOF
-if { (eval echo configure:3103: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="_cnt"
else
@@ -3109,14 +3072,14 @@ fi
rm -f conftest*
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3113 "configure"
+#line 3076 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->__cnt = 0;
; return 0; }
EOF
-if { (eval echo configure:3120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3083: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="__cnt"
else
@@ -3127,14 +3090,14 @@ rm -f conftest*
fi
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3131 "configure"
+#line 3094 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->_r = 0;
; return 0; }
EOF
-if { (eval echo configure:3138: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3101: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="_r"
else
@@ -3145,14 +3108,14 @@ rm -f conftest*
fi
if test "$rb_cv_fcnt" = ""; then
cat > conftest.$ac_ext <<EOF
-#line 3149 "configure"
+#line 3112 "configure"
#include "confdefs.h"
#include <stdio.h>
int main() {
FILE *f = stdin; f->readCount = 0;
; return 0; }
EOF
-if { (eval echo configure:3156: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_fcnt="readCount"
else
@@ -3177,9 +3140,24 @@ fi
if test "$ac_cv_func_getpwent" = yes; then
echo $ac_n "checking struct passwd""... $ac_c" 1>&6
-echo "configure:3181: checking struct passwd" >&5
+echo "configure:3144: checking struct passwd" >&5
+ cat > conftest.$ac_ext <<EOF
+#line 3146 "configure"
+#include "confdefs.h"
+#include <pwd.h>
+EOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ egrep "pw_gecos" >/dev/null 2>&1; then
+ rm -rf conftest*
+ cat >> confdefs.h <<\EOF
+#define PW_GECOS 1
+EOF
+
+fi
+rm -f conftest*
+
cat > conftest.$ac_ext <<EOF
-#line 3183 "configure"
+#line 3161 "configure"
#include "confdefs.h"
#include <pwd.h>
EOF
@@ -3194,7 +3172,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3198 "configure"
+#line 3176 "configure"
#include "confdefs.h"
#include <pwd.h>
EOF
@@ -3209,7 +3187,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3213 "configure"
+#line 3191 "configure"
#include "confdefs.h"
#include <pwd.h>
EOF
@@ -3224,7 +3202,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3228 "configure"
+#line 3206 "configure"
#include "confdefs.h"
#include <pwd.h>
EOF
@@ -3239,7 +3217,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3243 "configure"
+#line 3221 "configure"
#include "confdefs.h"
#include <pwd.h>
EOF
@@ -3254,7 +3232,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3258 "configure"
+#line 3236 "configure"
#include "confdefs.h"
#include <pwd.h>
EOF
@@ -3287,7 +3265,7 @@ fi
case "$host_os" in
linux*)
echo $ac_n "checking whether ELF binaries are produced""... $ac_c" 1>&6
-echo "configure:3291: checking whether ELF binaries are produced" >&5
+echo "configure:3269: checking whether ELF binaries are produced" >&5
if eval "test \"`echo '$''{'rb_cv_linux_elf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3295,7 +3273,7 @@ else
:
else
cat > conftest.$ac_ext <<EOF
-#line 3299 "configure"
+#line 3277 "configure"
#include "confdefs.h"
/* Test for whether ELF binaries are produced */
@@ -3315,7 +3293,7 @@ main() {
}
EOF
-if { (eval echo configure:3319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
rb_cv_linux_elf=yes
else
@@ -3345,7 +3323,7 @@ STATIC=
if test "$with_dln_a_out" != yes; then
rb_cv_dlopen=unknown
echo $ac_n "checking whether OS depend dynamic link works""... $ac_c" 1>&6
-echo "configure:3349: checking whether OS depend dynamic link works" >&5
+echo "configure:3327: checking whether OS depend dynamic link works" >&5
if test "$GCC" = yes; then
case "$host_os" in
nextstep*) ;;
@@ -3394,6 +3372,9 @@ echo "configure:3349: checking whether OS depend dynamic link works" >&5
human*) DLDFLAGS=''
LDSHARED=''
LDFLAGS='' ;;
+ beos*) LDSHARED="mwld -xms"
+ DLDFLAGS="-f ruby.exp"
+ rb_cv_dlopen=yes ;;
*) LDSHARED='ld' ;;
esac
echo "$ac_t""$rb_cv_dlopen" 1>&6
@@ -3403,13 +3384,13 @@ dln_a_out_works=no
if test "$ac_cv_header_a_out_h" = yes; then
if test "$with_dln_a_out" = yes || test "$rb_cv_dlopen" = unknown; then
echo $ac_n "checking whether matz's dln works""... $ac_c" 1>&6
-echo "configure:3407: checking whether matz's dln works" >&5
+echo "configure:3388: checking whether matz's dln works" >&5
cat confdefs.h > config.h
if eval "test \"`echo '$''{'rb_cv_dln_a_out'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3413 "configure"
+#line 3394 "configure"
#include "confdefs.h"
#define USE_DLN_A_OUT
@@ -3419,7 +3400,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:3423: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
rb_cv_dln_a_out=yes
else
@@ -3502,7 +3483,7 @@ fi
case "$host_os" in
human*)
echo $ac_n "checking for _harderr in -lsignal""... $ac_c" 1>&6
-echo "configure:3506: checking for _harderr in -lsignal" >&5
+echo "configure:3487: checking for _harderr in -lsignal" >&5
ac_lib_var=`echo signal'_'_harderr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3510,7 +3491,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsignal $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3514 "configure"
+#line 3495 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3521,7 +3502,7 @@ int main() {
_harderr()
; return 0; }
EOF
-if { (eval echo configure:3525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -3549,7 +3530,7 @@ else
fi
echo $ac_n "checking for hmemset in -lhmem""... $ac_c" 1>&6
-echo "configure:3553: checking for hmemset in -lhmem" >&5
+echo "configure:3534: checking for hmemset in -lhmem" >&5
ac_lib_var=`echo hmem'_'hmemset | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3557,7 +3538,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lhmem $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3561 "configure"
+#line 3542 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3568,7 +3549,7 @@ int main() {
hmemset()
; return 0; }
EOF
-if { (eval echo configure:3572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -3598,12 +3579,12 @@ fi
for ac_func in select
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3602: checking for $ac_func" >&5
+echo "configure:3583: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3607 "configure"
+#line 3588 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3626,7 +3607,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3651,7 +3632,7 @@ fi
done
echo $ac_n "checking whether PD libc _dtos18 fail to convert big number""... $ac_c" 1>&6
-echo "configure:3655: checking whether PD libc _dtos18 fail to convert big number" >&5
+echo "configure:3636: checking whether PD libc _dtos18 fail to convert big number" >&5
if eval "test \"`echo '$''{'rb_cv_missing__dtos18'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3659,7 +3640,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3663 "configure"
+#line 3644 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3671,7 +3652,7 @@ main ()
}
EOF
-if { (eval echo configure:3675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
rb_cv_missing__dtos18=yes
else
@@ -3693,7 +3674,7 @@ EOF
fi
echo $ac_n "checking whether PD libc fconvert fail to round""... $ac_c" 1>&6
-echo "configure:3697: checking whether PD libc fconvert fail to round" >&5
+echo "configure:3678: checking whether PD libc fconvert fail to round" >&5
if eval "test \"`echo '$''{'rb_cv_missing_fconvert'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3701,7 +3682,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3705 "configure"
+#line 3686 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3714,7 +3695,7 @@ main ()
}
EOF
-if { (eval echo configure:3718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
rb_cv_missing_fconvert=yes
else
@@ -3756,6 +3737,10 @@ if test "$fat_binary" = yes ; then
CFLAGS="$CFLAGS -pipe $ARCH_FLAG"
fi
+if test "$host_os" = "beos"; then
+ CFLAGS="$CFLAGS -relax_pointers"
+fi
+
ri_prefix=
test "$program_prefix" != NONE &&
ri_prefix=$program_prefix
diff --git a/configure.in b/configure.in
index e674d79..84aabbe 100644
--- a/configure.in
+++ b/configure.in
@@ -76,6 +76,7 @@ dnl Checks for libraries.
case "$host_os" in
nextstep*) ;;
human*) ;;
+beos*) ;;
*) LIBS="-lm $LIBS";;
esac
AC_CHECK_LIB(crypt, crypt)
@@ -87,7 +88,8 @@ AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(stdlib.h unistd.h limits.h sys/file.h sys/ioctl.h pwd.h \
sys/select.h sys/time.h sys/times.h sys/param.h sys/wait.h\
- syscall.h a.out.h string.h utime.h memory.h)
+ syscall.h a.out.h string.h utime.h memory.h\
+ varargs.h stdarg.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
@@ -114,7 +116,7 @@ AC_CHECK_FUNCS(fmod killpg random wait4 waitpid syscall getcwd\
truncate chsize times utimes fcntl lockf setitimer\
setruid seteuid setreuid setrgid setegid setregid\
setpgrp2 getpgid getgroups getpriority\
- dlopen sigprocmask sigaction _setjmp)
+ dlopen sigprocmask sigaction _setjmp setpgrp)
if test "$ac_cv_func_strftime" = no; then
AC_STRUCT_TIMEZONE
AC_TRY_LINK([],
@@ -207,6 +209,7 @@ fi
if test "$ac_cv_func_getpwent" = yes; then
AC_MSG_CHECKING(struct passwd)
+ AC_EGREP_HEADER(pw_gecos, pwd.h, AC_DEFINE(PW_GECOS))
AC_EGREP_HEADER(pw_change, pwd.h, AC_DEFINE(PW_CHANGE))
AC_EGREP_HEADER(pw_quota, pwd.h, AC_DEFINE(PW_QUOTA))
AC_EGREP_HEADER(pw_age, pwd.h, AC_DEFINE(PW_AGE))
@@ -316,6 +319,9 @@ if test "$with_dln_a_out" != yes; then
human*) DLDFLAGS=''
LDSHARED=''
LDFLAGS='' ;;
+ beos*) LDSHARED="mwld -xms"
+ DLDFLAGS="-f ruby.exp"
+ rb_cv_dlopen=yes ;;
*) LDSHARED='ld' ;;
esac
AC_MSG_RESULT($rb_cv_dlopen)
@@ -451,6 +457,10 @@ if test "$fat_binary" = yes ; then
CFLAGS="$CFLAGS -pipe $ARCH_FLAG"
fi
+if test "$host_os" = "beos"; then
+ CFLAGS="$CFLAGS -relax_pointers"
+fi
+
ri_prefix=
test "$program_prefix" != NONE &&
ri_prefix=$program_prefix
diff --git a/defines.h b/defines.h
index a24f9eb..096ad7e 100644
--- a/defines.h
+++ b/defines.h
@@ -13,7 +13,7 @@
#define RUBY
/* define EUC/SJIS for default kanji-code */
-#if defined(MSDOS) || defined(__CYGWIN32__) || defined(__human68k__)
+#if defined(MSDOS) || defined(__CYGWIN32__) || defined(__human68k__) || defined(__MACOS__)
#undef EUC
#define SJIS
#else
diff --git a/dir.c b/dir.c
index 17c6515..719fff2 100644
--- a/dir.c
+++ b/dir.c
@@ -50,6 +50,10 @@
char *getenv();
#endif
+#ifdef USE_CWGUSI
+# include <sys/errno.h>
+#endif
+
static VALUE cDir;
static void
@@ -144,7 +148,7 @@ dir_tell(dir)
DIR *dirp;
int pos;
-#if !defined(__CYGWIN32__)
+#if !defined(__CYGWIN32__) && !defined(__BEOS__)
GetDIR(dir, dirp);
pos = telldir(dirp);
return int2inum(pos);
@@ -159,7 +163,7 @@ dir_seek(dir, pos)
{
DIR *dirp;
-#if !defined(__CYGWIN32__)
+#if !defined(__CYGWIN32__) && !defined(__BEOS__)
GetDIR(dir, dirp);
seekdir(dirp, NUM2INT(pos));
return dir;
@@ -241,7 +245,7 @@ static VALUE
dir_s_chroot(dir, path)
VALUE dir, path;
{
-#if !defined(DJGPP) && !defined(NT) && !defined(__human68k__)
+#if !defined(DJGPP) && !defined(NT) && !defined(__human68k__) && !defined(USE_CWGUSI) && !defined(__BEOS__)
rb_secure(2);
Check_SafeStr(path);
@@ -272,7 +276,7 @@ dir_s_mkdir(argc, argv, obj)
}
Check_SafeStr(path);
-#ifndef NT
+#if !defined(NT) && !defined(USE_CWGUSI)
if (mkdir(RSTRING(path)->ptr, mode) == -1)
rb_sys_fail(RSTRING(path)->ptr);
#else
diff --git a/dln.c b/dln.c
index 56dc7a6..f907ef3 100644
--- a/dln.c
+++ b/dln.c
@@ -36,7 +36,9 @@ void *xrealloc();
#include <stdio.h>
#ifndef NT
-#include <sys/file.h>
+# ifndef USE_CWGUSI
+# include <sys/file.h>
+# endif
#else
#include "missing/file.h"
#endif
@@ -58,6 +60,16 @@ char *strdup();
char *getenv();
#endif
+#ifdef __MACOS__
+# include <TextUtils.h>
+# include <CodeFragments.h>
+# include <Aliases.h>
+#endif
+
+#ifdef __BEOS__
+# include <image.h>
+#endif
+
int eaccess();
#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT)
@@ -81,7 +93,11 @@ init_funcname(buf, file)
/* Load the file as an object one */
for (p = file, slash = p-1; *p; p++) /* Find position of last '/' */
+#ifdef __MACOS__
+ if (*p == ':') slash = p;
+#else
if (*p == '/') slash = p;
+#endif
sprintf(buf, FUNCNAME_PATTERN, slash + 1);
for (p = buf; *p; p++) { /* Delete suffix it it exists */
@@ -1327,6 +1343,93 @@ dln_load(file)
}
#endif
+#ifdef __BEOS__
+# define DLN_DEFINED
+ {
+ status_t err_stat; /* BeOS error status code */
+ image_id img_id; /* extention module unique id */
+ void (*init_fct)(); /* initialize function for extention module */
+
+ /* load extention module */
+ img_id = load_add_on(file);
+ if (img_id <= 0) {
+ LoadError("Failed to load %.200s", file);
+ }
+
+ /* find symbol for module initialize function. */
+ /* The Be Book KernelKit Images section described to use
+ B_SYMBOL_TYPE_TEXT for symbol of function, not
+ B_SYMBOL_TYPE_CODE. Why ? */
+ /* strcat(init_fct_symname, "__Fv"); */ /* parameter nothing. */
+ /* "__Fv" dont need! The Be Book Bug ? */
+ err_stat = get_image_symbol(img_id, buf,
+ B_SYMBOL_TYPE_TEXT, &init_fct);
+
+ if ((B_BAD_IMAGE_ID == err_stat) || (B_BAD_INDEX == err_stat)) {
+ unload_add_on(img_id);
+ LoadError("Failed to lookup Init function %.200s", file);
+ }
+ else if (B_NO_ERROR != err_stat) {
+ char errmsg[] = "Internal of BeOS version. %.200s (symbol_name = %s)";
+ unload_add_on(img_id);
+ LoadError(errmsg, strerror(err_stat), buf);
+ }
+
+ /* call module initialize function. */
+ (*init_fct)();
+ return;
+ }
+#endif /* __BEOS__*/
+
+#ifdef __MACOS__
+# define DLN_DEFINED
+ {
+ OSErr err;
+ FSSpec libspec;
+ CFragConnectionID connID;
+ Ptr mainAddr;
+ char errMessage[1024];
+ Boolean isfolder, didsomething;
+ Str63 fragname;
+ Ptr symAddr;
+ CFragSymbolClass class;
+ void (*init_fct)();
+ char fullpath[MAXPATHLEN];
+ extern LoadError();
+
+ strcpy(fullpath, file);
+
+ /* resolve any aliases to find the real file */
+ c2pstr(fullpath);
+ (void)FSMakeFSSpec(0, 0, fullpath, &libspec);
+ err = ResolveAliasFile(&libspec, 1, &isfolder, &didsomething);
+ if ( err ) {
+ LoadError("Unresolved Alias - %s", file);
+ }
+
+ /* Load the fragment (or return the connID if it is already loaded */
+ fragname[0] = 0;
+ err = GetDiskFragment(&libspec, 0, 0, fragname,
+ kLoadCFrag, &connID, &mainAddr,
+ errMessage);
+ if ( err ) {
+ p2cstr(errMessage);
+ LoadError("%s - %s",errMessage , file);
+ }
+
+ /* Locate the address of the correct init function */
+ c2pstr(buf);
+ err = FindSymbol(connID, buf, &symAddr, &class);
+ if ( err ) {
+ LoadError("Unresolved symbols - %s" , file);
+ }
+
+ init_fct = (void (*)())symAddr;
+ (*init_fct)();
+ return;
+ }
+#endif /* __MACOS__ */
+
#ifndef DLN_DEFINED
rb_notimplement("dynamic link not supported");
#endif
@@ -1409,6 +1512,7 @@ dln_find_1(fname, path, exe_flag)
conv_to_posix_path(path, rubypath);
path = rubypath;
#endif
+#ifndef __MACOS__
if (fname[0] == '/') return fname;
if (strncmp("./", fname, 2) == 0 || strncmp("../", fname, 3) == 0)
return fname;
@@ -1418,6 +1522,7 @@ dln_find_1(fname, path, exe_flag)
if (strncmp(".\\", fname, 2) == 0 || strncmp("..\\", fname, 3) == 0)
return fname;
#endif
+#endif /* __MACOS__ */
for (dp = path;; dp = ++ep) {
register int l;
@@ -1425,7 +1530,7 @@ dln_find_1(fname, path, exe_flag)
int fspace;
/* extract a component */
-#if !defined(MSDOS) && !defined(NT) && !defined(__human68k__)
+#if !defined(MSDOS) && !defined(NT) && !defined(__human68k__) && !defined(__MACOS__)
ep = strchr(dp, ':');
#else
ep = strchr(dp, ';');
@@ -1473,7 +1578,11 @@ dln_find_1(fname, path, exe_flag)
/* add a "/" between directory and filename */
if (ep[-1] != '/')
+#ifdef __MACOS__
+ *bp++ = ':';
+#else
*bp++ = '/';
+#endif
}
/* now append the file name */
diff --git a/enum.c b/enum.c
index 3b804fa..655cebe 100644
--- a/enum.c
+++ b/enum.c
@@ -356,6 +356,7 @@ enum_length(obj)
return INT2FIX(length);
}
+static VALUE
each_with_index_i(val, indexp)
VALUE val;
int *indexp;
diff --git a/error.c b/error.c
index cb6e8c8..f2ab258 100644
--- a/error.c
+++ b/error.c
@@ -13,7 +13,18 @@
#include "ruby.h"
#include "env.h"
#include <stdio.h>
+#ifdef __STDC__
+#include <stdarg.h>
+#define va_init_list(a,b) va_start(a,b)
+#else
#include <varargs.h>
+#define va_init_list(a,b) va_start(a)
+#endif
+
+#ifdef USE_CWGUSI
+#include <sys/errno.h>
+int sys_nerr = 256;
+#endif
extern char *sourcefile;
extern int sourceline;
@@ -34,28 +45,7 @@ err_sprintf(buf, fmt, args)
}
}
-static void
-err_append(s)
- char *s;
-{
- extern VALUE errinfo;
-
- if (rb_in_eval) {
- if (NIL_P(errinfo)) {
- errinfo = str_new2(s);
- }
- else {
- str_cat(errinfo, "\n", 1);
- str_cat(errinfo, s, strlen(s));
- }
- }
- else {
- fputs(s, stderr);
- fputs("\n", stderr);
- fflush(stderr);
- }
-}
-
+static void err_append _((char*));
static void
err_print(fmt, args)
char *fmt;
@@ -68,52 +58,68 @@ err_print(fmt, args)
}
void
+#ifdef __STDC__
+Error(char *fmt, ...)
+#else
Error(fmt, va_alist)
char *fmt;
va_dcl
+#endif
{
va_list args;
- va_start(args);
+ va_init_list(args, fmt);
err_print(fmt, args);
va_end(args);
nerrs++;
}
void
+#ifdef __STDC__
+Error_Append(char *fmt, ...)
+#else
Error_Append(fmt, va_alist)
char *fmt;
va_dcl
+#endif
{
va_list args;
char buf[BUFSIZ];
- va_start(args);
+ va_init_list(args, fmt);
vsprintf(buf, fmt, args);
va_end(args);
err_append(buf);
}
void
+#ifdef __STDC__
+Warn(char *fmt, ...)
+#else
Warn(fmt, va_alist)
char *fmt;
va_dcl
+#endif
{
char buf[BUFSIZ];
va_list args;
sprintf(buf, "warning: %s", fmt);
- va_start(args);
+ va_init_list(args, fmt);
err_print(buf, args);
va_end(args);
}
/* Warning() reports only in verbose mode */
void
+#ifdef __STDC__
+Warning(char *fmt, ...)
+#else
Warning(fmt, va_alist)
char *fmt;
va_dcl
+#endif
{
char buf[BUFSIZ];
va_list args;
@@ -122,15 +128,19 @@ Warning(fmt, va_alist)
sprintf(buf, "warning: %s", fmt);
- va_start(args);
+ va_init_list(args, fmt);
err_print(buf, args);
va_end(args);
}
void
+#ifdef __STDC__
+Bug(char *fmt, ...)
+#else
Bug(fmt, va_alist)
char *fmt;
va_dcl
+#endif
{
char buf[BUFSIZ];
va_list args;
@@ -138,7 +148,7 @@ Bug(fmt, va_alist)
sprintf(buf, "[BUG] %s", fmt);
rb_in_eval = 0;
- va_start(args);
+ va_init_list(args, fmt);
err_print(buf, args);
va_end(args);
abort();
@@ -172,7 +182,9 @@ static struct types {
-1, 0,
};
+#ifndef __STDC__
extern void TypeError();
+#endif
void
rb_check_type(x, t)
@@ -369,7 +381,6 @@ exception(argc, argv)
int argc;
VALUE *argv;
{
- void ArgError();
VALUE v = Qnil;
VALUE etype = eStandardError;
int i;
@@ -403,7 +414,60 @@ exception(argc, argv)
return v;
}
+#ifdef __BEOS__
+typedef struct {
+ VALUE *list;
+ size_t n;
+} syserr_list_entry;
+
+typedef struct {
+ int ix;
+ size_t n;
+} syserr_index_entry;
+
+static VALUE syserr_list_b_general[16+1];
+static VALUE syserr_list_b_os0[2+1];
+static VALUE syserr_list_b_os1[5+1];
+static VALUE syserr_list_b_os2[2+1];
+static VALUE syserr_list_b_os3[3+1];
+static VALUE syserr_list_b_os4[1+1];
+static VALUE syserr_list_b_app[15+1];
+static VALUE syserr_list_b_interface[0+1];
+static VALUE syserr_list_b_media[8+1];
+static VALUE syserr_list_b_midi[0+1];
+static VALUE syserr_list_b_storage[15+1];
+static VALUE syserr_list_b_posix[38+1];
+static VALUE syserr_list_b_mail[8+1];
+static VALUE syserr_list_b_print[1+1];
+static VALUE syserr_list_b_device[14+1];
+
+# define SYSERR_LIST_B(n) {(n), sizeof(n)/sizeof(VALUE)}
+static const syserr_list_entry syserr_list[] = {
+ SYSERR_LIST_B(syserr_list_b_general),
+ SYSERR_LIST_B(syserr_list_b_os0),
+ SYSERR_LIST_B(syserr_list_b_os1),
+ SYSERR_LIST_B(syserr_list_b_os2),
+ SYSERR_LIST_B(syserr_list_b_os3),
+ SYSERR_LIST_B(syserr_list_b_os4),
+ SYSERR_LIST_B(syserr_list_b_app),
+ SYSERR_LIST_B(syserr_list_b_interface),
+ SYSERR_LIST_B(syserr_list_b_media),
+ SYSERR_LIST_B(syserr_list_b_midi),
+ SYSERR_LIST_B(syserr_list_b_storage),
+ SYSERR_LIST_B(syserr_list_b_posix),
+ SYSERR_LIST_B(syserr_list_b_mail),
+ SYSERR_LIST_B(syserr_list_b_print),
+ SYSERR_LIST_B(syserr_list_b_device),
+};
+# undef SYSERR_LIST_B
+
+static const syserr_index_entry syserr_index[]= {
+ {0, 1}, {1, 5}, {6, 1}, {7, 1}, {8, 1}, {9, 1}, {10, 1}, {11, 1},
+ {12, 1}, {13, 1}, {14, 1}, {0, 0},
+};
+#else
static VALUE *syserr_list;
+#endif
#ifndef NT
extern int sys_nerr;
@@ -465,64 +529,84 @@ Init_Exception()
rb_define_global_function("Exception", exception, -1);
}
-#define RAISE_ERROR(klass) {\
+#define RAISE_ERROR(klass,fmt) {\
va_list args;\
char buf[BUFSIZ];\
-\
- va_start(args);\
- vsprintf(buf, fmt, args);\
- va_end(args);\
-\
+ va_init_list(args,fmt);\
rb_raise(exc_new2(klass, buf));\
}
void
+#ifdef __STDC__
+Raise(VALUE exc, char *fmt, ...)
+#else
Raise(exc, fmt, va_alist)
VALUE exc;
char *fmt;
va_dcl
+#endif
{
- RAISE_ERROR(exc);
+ RAISE_ERROR(exc, fmt);
}
void
+#ifdef __STDC__
+TypeError(char *fmt, ...)
+#else
TypeError(fmt, va_alist)
char *fmt;
va_dcl
+#endif
{
- RAISE_ERROR(eTypeError);
+ RAISE_ERROR(eTypeError, fmt);
}
void
+#ifdef __STDC__
+ArgError(char *fmt, ...)
+#else
ArgError(fmt, va_alist)
char *fmt;
va_dcl
+#endif
{
- RAISE_ERROR(eArgError);
+ RAISE_ERROR(eArgError, fmt);
}
void
+#ifdef __STDC__
+NameError(char *fmt, ...)
+#else
NameError(fmt, va_alist)
char *fmt;
va_dcl
+#endif
{
- RAISE_ERROR(eNameError);
+ RAISE_ERROR(eNameError, fmt);
}
void
+#ifdef __STDC__
+IndexError(char *fmt, ...)
+#else
IndexError(fmt, va_alist)
char *fmt;
va_dcl
+#endif
{
- RAISE_ERROR(eIndexError);
+ RAISE_ERROR(eIndexError, fmt);
}
void
+#ifdef __STDC__
+Fail(char *fmt, ...)
+#else
Fail(fmt, va_alist)
char *fmt;
va_dcl
+#endif
{
- RAISE_ERROR(eRuntimeError);
+ RAISE_ERROR(eRuntimeError, fmt);
}
void
@@ -534,22 +618,30 @@ rb_notimplement()
}
void
+#ifdef __STDC__
+LoadError(char *fmt, ...)
+#else
LoadError(fmt, va_alist)
char *fmt;
va_dcl
+#endif
{
- RAISE_ERROR(eLoadError);
+ RAISE_ERROR(eLoadError, fmt);
}
void
+#ifdef __STDC__
+Fatal(char *fmt, ...)
+#else
Fatal(fmt, va_alist)
char *fmt;
va_dcl
+#endif
{
va_list args;
char buf[BUFSIZ];
- va_start(args);
+ va_init_list(args, fmt);
vsprintf(buf, fmt, args);
va_end(args);
@@ -581,6 +673,26 @@ rb_sys_fail(mesg)
}
errno = 0;
+#ifdef __BEOS__
+ ee = get_syserr(n);
+ if (!ee) {
+ char name[6];
+
+ sprintf(name, "E%03d", n);
+ ee = set_syserr(n, name);
+ }
+#else
+# ifdef USE_CWGUSI
+ if (n < 0) {
+ int macoserr_index = sys_nerr - 1;
+ if (!syserr_list[macoserr_index]) {
+ char name[6];
+ sprintf(name, "E%03d", macoserr_index);
+ ee = set_syserr(macoserr_index, name);
+ }
+ }
+ else
+#endif /* USE_CWGUSI */
if (n > sys_nerr || !syserr_list[n]) {
char name[6];
@@ -591,6 +703,7 @@ rb_sys_fail(mesg)
ee = syserr_list[n];
}
ee = exc_new2(ee, buf);
+#endif
rb_iv_set(ee, "errno", INT2FIX(n));
rb_raise(ee);
}
@@ -972,3 +1085,28 @@ init_syserr()
set_syserr(EDQUOT, "EDQUOT");
#endif
}
+
+static void
+err_append(s)
+ char *s;
+{
+ extern VALUE errinfo;
+
+ if (rb_in_eval) {
+ if (NIL_P(errinfo)) {
+ errinfo = exc_new2(eSyntaxError, s);
+ }
+ else {
+ VALUE str = str_to_str(errinfo);
+
+ str_cat(str, "\n", 1);
+ str_cat(str, s, strlen(s));
+ errinfo = exc_new3(eSyntaxError, str);
+ }
+ }
+ else {
+ fputs(s, stderr);
+ fputs("\n", stderr);
+ fflush(stderr);
+ }
+}
diff --git a/eval.c b/eval.c
index f4cd910..2b563dc 100644
--- a/eval.c
+++ b/eval.c
@@ -28,6 +28,16 @@ char *strrchr _((char*,char));
#include <unistd.h>
#endif
+#ifdef __BEOS__
+#include <net/socket.h>
+#endif
+
+#ifdef USE_CWGUSI
+#include <sys/stat.h>
+#include <sys/errno.h>
+#include <compat.h>
+#endif
+
#ifndef setjmp
#ifdef HAVE__SETJMP
#define setjmp(env) _setjmp(env)
@@ -35,6 +45,12 @@ char *strrchr _((char*,char));
#endif
#endif
+#if defined(MSDOS) || defined(NT) || defined(__human68k__) || defined(__MACOS__)
+#define RUBY_LIB_SEP ";"
+#else
+#define RUBY_LIB_SEP ":"
+#endif
+
VALUE cProc;
static VALUE cBinding;
static VALUE proc_call _((VALUE,VALUE));
@@ -800,7 +816,7 @@ error_print()
}
}
-#ifndef NT
+#if !defined(NT) && !defined(__MACOS__)
extern char **environ;
#endif
char **origenviron;
@@ -821,7 +837,11 @@ ruby_init()
the_frame = top_frame = &frame;
the_iter = &iter;
+#ifdef __MACOS__
+ origenviron = 0;
+#else
origenviron = environ;
+#endif
init_heap();
PUSH_SCOPE();
@@ -2664,10 +2684,6 @@ rb_iter_break()
JUMP_TAG(TAG_BREAK);
}
-#ifdef __GNUC__
-static volatile voidfn rb_longjmp;
-#endif
-
static VALUE make_backtrace _((void));
static void
@@ -3085,7 +3101,7 @@ rb_rescue(b_proc, data1, r_proc, data2)
VALUE
rb_ensure(b_proc, data1, e_proc, data2)
VALUE (*b_proc)();
- void (*e_proc)();
+ VALUE (*e_proc)();
VALUE data1, data2;
{
int state;
@@ -3589,14 +3605,24 @@ f_send(argc, argv, recv)
}
+#ifdef __STDC__
+#include <stdarg.h>
+#define va_init_list(a,b) va_start(a,b)
+#else
#include <varargs.h>
+#define va_init_list(a,b) va_start(a)
+#endif
VALUE
+#ifdef __STDC__
+rb_funcall(VALUE recv, ID mid, int n, ...)
+#else
rb_funcall(recv, mid, n, va_alist)
VALUE recv;
ID mid;
int n;
va_dcl
+#endif
{
va_list ar;
VALUE *argv;
@@ -3606,7 +3632,7 @@ rb_funcall(recv, mid, n, va_alist)
argv = ALLOCA_N(VALUE, n);
- va_start(ar);
+ va_init_list(ar, n);
for (i=0;i<n;i++) {
argv[i] = va_arg(ar, VALUE);
}
@@ -3993,10 +4019,10 @@ is_absolute_path(path)
char *path;
{
if (path[0] == '/') return 1;
-#if defined(MSDOS) || defined(NT) || defined(__human68k__)
+# if defined(MSDOS) || defined(NT) || defined(__human68k__)
if (path[0] == '\\') return 1;
if (strlen(path) > 2 && path[1] == ':') return 1;
-#endif
+# endif
return 0;
}
@@ -4023,11 +4049,7 @@ find_file(file)
for (i=0;i<RARRAY(rb_load_path)->len;i++) {
Check_SafeStr(RARRAY(rb_load_path)->ptr[i]);
}
-#if !defined(MSDOS) && !defined(NT) && !defined(__human68k__)
- vpath = ary_join(rb_load_path, str_new2(":"));
-#else
- vpath = ary_join(rb_load_path, str_new2(";"));
-#endif
+ vpath = ary_join(rb_load_path, str_new2(RUBY_LIB_SEP));
Check_SafeStr(vpath);
path = RSTRING(vpath)->ptr;
}
@@ -4048,9 +4070,11 @@ f_load(obj, fname)
TMP_PROTECT;
Check_SafeStr(fname);
+#ifndef __MACOS__
if (RSTRING(fname)->ptr[0] == '~') {
fname = file_s_expand_path(0, fname);
}
+#endif
file = find_file(RSTRING(fname)->ptr);
if (!file) LoadError("No such file to load -- %s", RSTRING(fname)->ptr);
@@ -6498,3 +6522,4 @@ return_check()
}
#endif
}
+
diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
index 2ecc725..9bd9818 100644
--- a/ext/dbm/dbm.c
+++ b/ext/dbm/dbm.c
@@ -15,6 +15,9 @@
#include <ndbm.h>
#include <fcntl.h>
#include <errno.h>
+#ifdef USE_CWGUSI
+# include <sys/errno.h>
+#endif
VALUE cDBM;
@@ -331,7 +334,7 @@ fdbm_store(obj, keystr, valstr)
#ifdef HAVE_DBM_CLAERERR
dbm_clearerr(dbm);
#endif
- if (errno == EPERM) rb_sys_fail(Qnil);
+ if (errno == EPERM) rb_sys_fail(0);
Fail("dbm_store failed");
}
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index 203df63..7bb7796 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -52,7 +52,9 @@ setup_passwd(pwd)
str_new2(pwd->pw_passwd),
INT2FIX(pwd->pw_uid),
INT2FIX(pwd->pw_gid),
+#ifdef PW_GECOS
str_new2(pwd->pw_gecos),
+#endif
str_new2(pwd->pw_dir),
str_new2(pwd->pw_shell),
#ifdef PW_CHANGE
diff --git a/ext/md5/md5init.c b/ext/md5/md5init.c
index 894f52a..65fd996 100644
--- a/ext/md5/md5init.c
+++ b/ext/md5/md5init.c
@@ -61,6 +61,9 @@ md5_clone(obj)
static VALUE
md5_new(argc, argv, class)
+ int argc;
+ VALUE* argv;
+ VALUE class;
{
int i;
VALUE arg, obj;
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index 4d7cb0f..07de964 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -22,6 +22,13 @@
#include <sys/un.h>
#endif
+#ifdef USE_CWGUSI
+extern int fileno(FILE *stream); /* <unix.mac.h> */
+extern int thread_select(int, fd_set*, fd_set*, fd_set*, struct timeval*); /* thread.c */
+# include <sys/errno.h>
+# include <GUSI.h>
+#endif
+
#if defined(THREAD) && defined(HAVE_FCNTL)
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
@@ -168,6 +175,7 @@ static VALUE
bsock_getsockopt(sock, lev, optname)
VALUE sock, lev, optname;
{
+#if !defined(__BEOS__)
int level, option, len;
char *buf;
OpenFile *fptr;
@@ -182,6 +190,9 @@ bsock_getsockopt(sock, lev, optname)
rb_sys_fail(fptr->path);
return str_new(buf, len);
+#else
+ rb_notimplement();
+#endif
}
static VALUE
@@ -401,7 +412,11 @@ thread_connect(fd, sockaddr, len, type)
#endif
FD_ZERO(&fds);
FD_SET(fd, &fds);
+#ifndef USE_CWGUSI
thread_select(fd+1, 0, &fds, 0, 0, 0);
+#else
+ thread_select(fd+1, 0, &fds, 0, 0);
+#endif
continue;
#endif
@@ -446,7 +461,11 @@ open_inet(class, h, serv, type)
host = RSTRING(h)->ptr;
hostent = gethostbyname(host);
if (hostent == NULL) {
+#ifndef USE_CWGUSI
hostaddr = inet_addr(host);
+#else
+ hostaddr = inet_addr(host).s_addr;
+#endif
if (hostaddr == -1) {
if (type == INET_SERVER && !strlen(host))
hostaddr = INADDR_ANY;
@@ -484,12 +503,16 @@ open_inet(class, h, serv, type)
_servent.s_proto = "tcp";
servent = &_servent;
}
+#ifdef __BEOS__
+ fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+#else
protoent = getprotobyname(servent->s_proto);
if (protoent == NULL) {
Raise(eSocket, "no such proto %s", servent->s_proto);
}
fd = socket(AF_INET, SOCK_STREAM, protoent->p_proto);
+#endif
memset(&sockaddr, 0, sizeof(sockaddr));
sockaddr.sin_family = AF_INET;
@@ -1060,8 +1083,10 @@ setup_domain_and_type(domain, dv, type, tv)
else if (strcmp(ptr, "AF_IMPLINK") == 0)
*dv = AF_IMPLINK;
#endif
+#ifdef PF_INET
else if (strcmp(ptr, "PF_INET") == 0)
*dv = PF_INET;
+#endif
#ifdef PF_UNIX
else if (strcmp(ptr, "PF_UNIX") == 0)
*dv = PF_UNIX;
@@ -1474,7 +1499,9 @@ Init_socket()
mConst = rb_define_module_under(cSocket, "Constants");
sock_define_const("SOCK_STREAM", SOCK_STREAM);
sock_define_const("SOCK_DGRAM", SOCK_DGRAM);
+#ifdef SOCK_RAW
sock_define_const("SOCK_RAW", SOCK_RAW);
+#endif
#ifdef SOCK_RDM
sock_define_const("SOCK_RDM", SOCK_RDM);
#endif
@@ -1486,7 +1513,9 @@ Init_socket()
#endif
sock_define_const("AF_INET", AF_INET);
+#ifdef PF_INET
sock_define_const("PF_INET", PF_INET);
+#endif
#ifdef AF_UNIX
sock_define_const("AF_UNIX", AF_UNIX);
sock_define_const("PF_UNIX", PF_UNIX);
@@ -1505,8 +1534,12 @@ Init_socket()
#endif
sock_define_const("MSG_OOB", MSG_OOB);
+#ifdef MSG_PEEK
sock_define_const("MSG_PEEK", MSG_PEEK);
+#endif
+#ifdef MSG_DONTROUTE
sock_define_const("MSG_DONTROUTE", MSG_DONTROUTE);
+#endif
sock_define_const("SOL_SOCKET", SOL_SOCKET);
#ifdef SOL_IP
@@ -1550,7 +1583,9 @@ Init_socket()
#ifdef SO_RCVBUF
sock_define_const("SO_RCVBUF", SO_RCVBUF);
#endif
+#ifdef SO_KEEPALIVE
sock_define_const("SO_KEEPALIVE", SO_KEEPALIVE);
+#endif
#ifdef SO_OOBINLINE
sock_define_const("SO_OOBINLINE", SO_OOBINLINE);
#endif
@@ -1560,7 +1595,9 @@ Init_socket()
#ifdef SO_PRIORITY
sock_define_const("SO_PRIORITY", SO_PRIORITY);
#endif
+#ifdef SO_LINGER
sock_define_const("SO_LINGER", SO_LINGER);
+#endif
#ifdef SOPRI_INTERACTIVE
sock_define_const("SOPRI_INTERACTIVE", SOPRI_INTERACTIVE);
diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c
index 6cb017a..952a9f7 100644
--- a/ext/tcltklib/tcltklib.c
+++ b/ext/tcltklib/tcltklib.c
@@ -11,6 +11,11 @@
#include <tcl.h>
#include <tk.h>
+#ifdef __MACOS__
+# include <tkMac.h>
+# include <Quickdraw.h>
+#endif
+
/* for debug */
#define DUMP1(ARG1) if (debug) { fprintf(stderr, "tcltklib: %s\n", ARG1);}
@@ -112,7 +117,7 @@ ip_ruby(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
DUMP2("rb_eval_string(%s)", argv[1]);
old_trapflg = trap_immediate;
trap_immediate = 0;
- res = rb_rescue(rb_eval_string, argv[1], ip_eval_rescue, &failed);
+ res = rb_rescue(rb_eval_string, (VALUE)argv[1], ip_eval_rescue, (VALUE)&failed);
trap_immediate = old_trapflg;
if (failed) {
@@ -253,6 +258,15 @@ ip_retval(VALUE self)
return (INT2FIX(ptr->return_value));
}
+#ifdef __MACOS__
+static void
+_macinit()
+{
+ tcl_macQdPtr = &qd; /* setup QuickDraw globals */
+ Tcl_MacSetEventProc(TkMacConvertEvent); /* setup event handler */
+}
+#endif
+
/*---- initialization ----*/
void Init_tcltklib()
{
@@ -269,6 +283,10 @@ void Init_tcltklib()
rb_define_method(ip, "_return_value", ip_retval, 0);
rb_define_method(ip, "mainloop", lib_mainloop, 0);
+#ifdef __MACOS__
+ _macinit();
+#endif
+
/*---- initialize tcl/tk libraries ----*/
/* from Tk_Main() */
DUMP1("Tcl_FindExecutable");
diff --git a/file.c b/file.c
index 845ca13..2404211 100644
--- a/file.c
+++ b/file.c
@@ -54,6 +54,12 @@ char *strdup();
char *getenv();
#endif
+#ifdef USE_CWGUSI
+ #include "macruby_missing.h"
+ extern int fileno(FILE *stream);
+ extern int utimes();
+#endif
+
extern VALUE cIO;
VALUE cFile;
VALUE mFileTest;
@@ -190,7 +196,9 @@ file_path(obj)
}
#ifndef NT
-#include <sys/file.h>
+# ifndef USE_CWGUSI
+# include <sys/file.h>
+# endif
#else
#include "missing/file.h"
#endif
@@ -309,7 +317,7 @@ static int
group_member(gid)
GETGROUPS_T gid;
{
-#ifndef NT
+#if !defined(NT) && !defined(USE_CWGUSI)
if (getgid() == gid || getegid() == gid)
return TRUE;
@@ -853,7 +861,7 @@ file_chmod(obj, vmode)
mode = NUM2INT(vmode);
GetOpenFile(obj, fptr);
-#if defined(DJGPP) || defined(NT)
+#if defined(DJGPP) || defined(NT) || defined(USE_CWGUSI) || defined(__BEOS__)
if (chmod(fptr->path, mode) == -1)
rb_sys_fail(fptr->path);
#else
@@ -912,7 +920,7 @@ file_chown(obj, owner, group)
rb_secure(2);
GetOpenFile(obj, fptr);
-#if defined(DJGPP) || defined(__CYGWIN32__) || defined(NT)
+#if defined(DJGPP) || defined(__CYGWIN32__) || defined(NT) || defined(USE_CWGUSI)
if (chown(fptr->path, NUM2INT(owner), NUM2INT(group)) == -1)
rb_sys_fail(fptr->path);
#else
@@ -1004,12 +1012,16 @@ static VALUE
file_s_link(obj, from, to)
VALUE obj, from, to;
{
+#if defined(USE_CWGUSI)
+ rb_notimplement();
+#else
Check_SafeStr(from);
Check_SafeStr(to);
if (link(RSTRING(from)->ptr, RSTRING(to)->ptr) < 0)
rb_sys_fail(RSTRING(from)->ptr);
return INT2FIX(0);
+#endif /* USE_CWGUSI */
}
static VALUE
@@ -1083,6 +1095,9 @@ file_s_umask(argc, argv)
int argc;
VALUE *argv;
{
+#ifdef USE_CWGUSI
+ rb_notimplement();
+#else
int omask = 0;
if (argc == 0) {
@@ -1096,6 +1111,7 @@ file_s_umask(argc, argv)
ArgError("wrong # of argument");
}
return INT2FIX(omask);
+#endif /* USE_CWGUSI */
}
VALUE
@@ -1378,6 +1394,9 @@ file_flock(obj, operation)
VALUE obj;
VALUE operation;
{
+#ifdef USE_CWGUSI
+ rb_notimplement();
+#else
OpenFile *fptr;
rb_secure(2);
@@ -1392,6 +1411,7 @@ file_flock(obj, operation)
rb_sys_fail(fptr->path);
}
return INT2FIX(0);
+#endif /* USE_CWGUSI */
}
#undef flock
diff --git a/fnmatch.c b/fnmatch.c
index 0847f5c..baa6c9a 100644
--- a/fnmatch.c
+++ b/fnmatch.c
@@ -20,6 +20,10 @@ Cambridge, MA 02139, USA. */
#include <errno.h>
#include "fnmatch.h"
+#ifdef USE_CWGUSI
+#include <sys/errno.h>
+#endif
+
#if !defined (__GNU_LIBRARY__) && !defined (STDC_HEADERS)
# if !defined (errno)
extern int errno;
diff --git a/gc.c b/gc.c
index 044d667..8984dbb 100644
--- a/gc.c
+++ b/gc.c
@@ -19,6 +19,9 @@
#include <stdio.h>
#include <setjmp.h>
+void re_free_registers _((struct re_registers*));
+void io_fptr_finalize _((struct OpenFile*));
+
#ifndef setjmp
#ifdef HAVE__SETJMP
#define setjmp(env) _setjmp(env)
diff --git a/glob.c b/glob.c
index 6c355ad..7e48620 100644
--- a/glob.c
+++ b/glob.c
@@ -52,7 +52,7 @@
# endif /* !USG */
#endif /* !HAVE_DIRENT_H */
-#if defined (_POSIX_SOURCE) || defined(DJGPP)
+#if defined (_POSIX_SOURCE) || defined(DJGPP) || defined(USE_CWGUSI)
/* Posix does not require that the d_ino field be present, and some
systems do not provide it. */
# define REAL_DIR_ENTRY(dp) 1
diff --git a/hash.c b/hash.c
index 3ce2aae..ab84569 100644
--- a/hash.c
+++ b/hash.c
@@ -156,7 +156,7 @@ hash_delete_nil(key, value)
return ST_CONTINUE;
}
-static void
+static VALUE
hash_foreach_ensure(hash)
VALUE hash;
{
@@ -774,6 +774,8 @@ hash_update(hash1, hash2)
return hash1;
}
+#ifndef __MACOS__ /* environment variables nothing on MacOS. */
+
int env_path_tainted();
static int path_tainted = -1;
@@ -1131,6 +1133,8 @@ env_to_hash(obj)
return hash;
}
+#endif /* ifndef __MACOS__ environment variables nothing on MacOS. */
+
void
Init_Hash()
{
@@ -1188,6 +1192,7 @@ Init_Hash()
rb_define_method(cHash,"key?", hash_has_key, 1);
rb_define_method(cHash,"value?", hash_has_value, 1);
+#ifndef __MACOS__ /* environment variables nothing on MacOS. */
envtbl = obj_alloc(cObject);
rb_extend_object(envtbl, mEnumerable);
@@ -1216,4 +1221,8 @@ Init_Hash()
rb_define_singleton_method(envtbl,"to_hash", env_to_hash, 0);
rb_define_global_const("ENV", envtbl);
+#else /* __MACOS__ */
+ envtbl = hash_s_new(0, NULL, cHash);
+ rb_define_global_const("ENV", envtbl);
+#endif /* ifndef __MACOS__ environment variables nothing on MacOS. */
}
diff --git a/intern.h b/intern.h
index 9c13b7b..796b536 100644
--- a/intern.h
+++ b/intern.h
@@ -7,9 +7,10 @@ void memclear _((register VALUE*, register int));
VALUE assoc_new _((VALUE, VALUE));
VALUE ary_new _((void));
VALUE ary_new2 _((int));
-VALUE ary_new3();
-VALUE ary_new4 _((int, VALUE*));
+VALUE ary_new3 _((int,...));
+VALUE ary_new4 _((int, VALUE *));
VALUE ary_freeze _((VALUE));
+VALUE ary_aref(int, VALUE*, VALUE);
void ary_store _((VALUE, int, VALUE));
VALUE ary_push _((VALUE, VALUE));
VALUE ary_pop _((VALUE));
@@ -83,19 +84,11 @@ VALUE enum_length _((VALUE));
VALUE exc_new _((VALUE, char*, unsigned int));
VALUE exc_new2 _((VALUE, char*));
VALUE exc_new3 _((VALUE, VALUE));
-#ifdef __GNUC__
-volatile voidfn TypeError;
-volatile voidfn ArgError;
-volatile voidfn NameError;
-volatile voidfn IndexError;
-volatile voidfn LoadError;
-#else
-void TypeError();
-void ArgError();
-void NameError();
-void IndexError();
-void LoadError();
-#endif
+void TypeError _((char*, ...));
+void ArgError _((char*, ...));
+void NameError _((char*, ...));
+void IndexError _((char*, ...));
+void LoadError _((char*, ...));
/* eval.c */
void rb_remove_method _((VALUE, char*));
void rb_disable_super _((VALUE, char*));
@@ -267,8 +260,8 @@ VALUE str_upto _((VALUE, VALUE));
VALUE str_inspect _((VALUE));
VALUE str_split _((VALUE, char*));
/* struct.c */
-VALUE struct_new();
-VALUE struct_define();
+VALUE struct_new _((VALUE, ...));
+VALUE struct_define _((char*, ...));
VALUE struct_alloc _((VALUE, VALUE));
VALUE struct_aref _((VALUE, VALUE));
VALUE struct_aset _((VALUE, VALUE, VALUE));
diff --git a/io.c b/io.c
index e8fc257..4f01b4d 100644
--- a/io.c
+++ b/io.c
@@ -53,6 +53,17 @@ struct timeval {
#include <unistd.h>
#endif
+#ifdef USE_CWGUSI
+ #include <sys/errno.h>
+ #include <unix.mac.h>
+ #include <compat.h>
+ extern void Init_File();
+#endif
+
+#ifdef __BEOS__
+#include <net/socket.h>
+#endif
+
VALUE rb_ad_string();
VALUE cIO;
@@ -87,8 +98,14 @@ struct timeval time_timeval();
# ifdef FILE_COUNT
# define READ_DATA_PENDING(fp) ((fp)->FILE_COUNT > 0)
# else
+# if defined(__BEOS__)
+# define ReadDataPending(fp) (fp->state._eof == 0)
+# elif defined(USE_CWGUSI)
+# define ReadDataPending(fp) (fp->state.eof == 0)
+# else
/* requires systems own version of the ReadDataPending() */
extern int ReadDataPending();
+# endif
# define READ_DATA_PENDING(fp) ReadDataPending(fp)
# endif
#endif
@@ -354,7 +371,12 @@ read_all(port)
GetOpenFile(port, fptr);
io_readable(fptr);
+#ifdef __BEOS__
+ if (fstat(fileno(fptr->f), &st) == 0 && S_ISREG(st.st_mode)
+ && (st.st_dev > 3)) {
+#else
if (fstat(fileno(fptr->f), &st) == 0 && S_ISREG(st.st_mode)) {
+#endif
if (st.st_size == 0) return Qnil;
else {
int pos = ftell(fptr->f);
@@ -866,7 +888,7 @@ VALUE
io_binmode(io)
VALUE io;
{
-#if defined(NT) || defined(DJGPP) || defined(__CYGWIN32__) || defined(__human68k__)
+#if defined(NT) || defined(DJGPP) || defined(__CYGWIN32__) || defined(__human68k__) || defined(USE_CWGUSI)
OpenFile *fptr;
GetOpenFile(io, fptr);
@@ -876,10 +898,17 @@ io_binmode(io)
if (fptr->f2)
fmode(fptr->f2, _IOBIN);
#else
+# ifndef USE_CWGUSI
if (fptr->f && setmode(fileno(fptr->f), O_BINARY) == -1)
rb_sys_fail(fptr->path);
if (fptr->f2 && setmode(fileno(fptr->f2), O_BINARY) == -1)
rb_sys_fail(fptr->path);
+# else /* USE_CWGUSI */
+ if (fptr->f)
+ fptr->f->mode.binary_io = 1;
+ if (fptr->f2)
+ fptr->f2->mode.binary_io = 1;
+# endif /* USE_CWGUSI */
#endif
fptr->mode |= FMODE_BINMODE;
@@ -1046,6 +1075,7 @@ static VALUE
pipe_open(pname, mode)
char *pname, *mode;
{
+#ifndef USE_CWGUSI
int modef = io_mode_flags(mode);
OpenFile *fptr;
@@ -1159,6 +1189,9 @@ pipe_open(pname, mode)
}
}
#endif
+#else /* USE_CWGUSI */
+ rb_notimplement();
+#endif
}
static VALUE
@@ -1717,16 +1750,17 @@ next_argv()
#endif
}
fw = rb_fopen(fn, "w");
-#if !defined(MSDOS) && !defined(__CYGWIN32__) && !(NT) && !defined(__human68k__)
+#if !defined(MSDOS) && !defined(__CYGWIN32__) && !(NT) && !defined(__human68k__)\
+ && !defined(USE_CWGUSI) && !defined(__BEOS__)
fstat(fileno(fw), &st2);
fchmod(fileno(fw), st.st_mode);
if (st.st_uid!=st2.st_uid || st.st_gid!=st2.st_gid) {
fchown(fileno(fw), st.st_uid, st.st_gid);
}
#endif
- rb_defout = prep_stdio(fw, FMODE_WRITABLE, cIO);
+ rb_defout = prep_stdio(fw, FMODE_WRITABLE, cFile);
}
- file = prep_stdio(fr, FMODE_READABLE, cIO);
+ file = prep_stdio(fr, FMODE_READABLE, cFile);
}
}
else {
@@ -2107,7 +2141,11 @@ io_ctl(io, req, arg, io_p)
}
fd = fileno(fptr->f);
#ifdef HAVE_FCNTL
+# ifdef USE_CWGUSI
+ retval = io_p?ioctl(fd, cmd, (void*) narg):fcntl(fd, cmd, narg);
+# else
retval = io_p?ioctl(fd, cmd, narg):fcntl(fd, cmd, narg);
+# endif
#else
if (!io_p) {
rb_notimplement();
@@ -2306,7 +2344,7 @@ io_s_foreach(argc, argv, io)
arg.argc = argc - 1;
arg.io = io_open(RSTRING(fname)->ptr, "r");
- return rb_ensure(io_foreach_line, &arg, io_close, arg.io);
+ return rb_ensure(io_foreach_line, (VALUE)&arg, io_close, arg.io);
}
static VALUE
@@ -2337,7 +2375,7 @@ io_s_readlines(argc, argv, io)
arg.argc = argc - 1;
arg.io = io_open(RSTRING(fname)->ptr, "r");
- return rb_ensure(io_readline_line, &arg, io_close, arg.io);
+ return rb_ensure(io_readline_line, (VALUE)&arg, io_close, arg.io);
}
static VALUE
diff --git a/marshal.c b/marshal.c
index 0e417f7..3f604d0 100644
--- a/marshal.c
+++ b/marshal.c
@@ -445,7 +445,7 @@ marshal_dump(argc, argv)
w_byte(MARSHAL_MAJOR, &arg);
w_byte(MARSHAL_MINOR, &arg);
- rb_ensure(dump, &c_arg, dump_ensure, &arg);
+ rb_ensure(dump, (VALUE)&c_arg, dump_ensure, (VALUE)&arg);
return port;
}
@@ -846,7 +846,7 @@ marshal_load(argc, argv)
arg.data = st_init_numtable();
if (NIL_P(proc)) arg.proc = 0;
else arg.proc = proc;
- v = rb_ensure(load, &arg, load_ensure, &arg);
+ v = rb_ensure(load, (VALUE)&arg, load_ensure, (VALUE)&arg);
}
else {
TypeError("Old marshal file format (can't read)");
diff --git a/numeric.c b/numeric.c
index 1bf0092..9127a0d 100644
--- a/numeric.c
+++ b/numeric.c
@@ -12,6 +12,7 @@
#include "ruby.h"
#include <math.h>
+#include <stdio.h>
static ID coerce;
static ID to_i;
@@ -42,12 +43,14 @@ num_coerce(x, y)
return assoc_new(rb_Float(x), rb_Float(y));
}
+static VALUE
coerce_body(x)
VALUE *x;
{
return rb_funcall(x[1], coerce, 1, x[0]);
}
+static VALUE
coerce_rescue(x)
VALUE *x;
{
@@ -66,7 +69,7 @@ do_coerce(x, y)
VALUE a[2];
a[0] = *x; a[1] = *y;
- ary = rb_rescue(coerce_body, a, coerce_rescue, a);
+ ary = rb_rescue(coerce_body, (VALUE)a, coerce_rescue, (VALUE)a);
if (TYPE(ary) != T_ARRAY || RARRAY(ary)->len != 2) {
TypeError("coerce must return [x, y]");
}
diff --git a/object.c b/object.c
index 65f5fe9..0e3bfdf 100644
--- a/object.c
+++ b/object.c
@@ -15,7 +15,11 @@
#include <stdio.h>
VALUE mKernel;
+#ifdef __MACOS__ /* name conflict AERegistory.h */
+VALUE cRubyObject;
+#else
VALUE cObject;
+#endif
VALUE cModule;
VALUE cClass;
extern VALUE cFixnum;
@@ -776,7 +780,7 @@ rb_convert_type(val, type, tname, method)
arg1.val = arg2.val = val;
arg1.s = method;
arg2.s = tname;
- val = rb_rescue(to_type, &arg1, fail_to_type, &arg2);
+ val = rb_rescue(to_type, (VALUE)&arg1, fail_to_type, (VALUE)&arg2);
Check_Type(val, type);
return val;
}
diff --git a/parse.y b/parse.y
index 734d132..6f3f815 100644
--- a/parse.y
+++ b/parse.y
@@ -1545,6 +1545,7 @@ yyerror(msg)
{
UCHAR *p, *pe, *buf;
int len, i;
+ void Error_Append();
Error("%s", msg);
p = lex_p;
diff --git a/process.c b/process.c
index 314d3ea..d641dc5 100644
--- a/process.c
+++ b/process.c
@@ -43,6 +43,11 @@ struct timeval time_timeval();
#endif
#include "st.h"
+#ifdef USE_CWGUSI
+# include <sys/errno.h>
+# include "macruby_missing.h"
+#endif
+
static VALUE
get_pid()
{
@@ -256,9 +261,11 @@ security(str)
extern VALUE eSecurityError;
if (rb_safe_level() > 0) {
+#ifndef USE_CWGUSI
if (env_path_tainted()) {
Raise(eSecurityError, "Insecure PATH - %s", str);
}
+#endif
}
}
@@ -267,6 +274,7 @@ proc_exec_v(argv, prog)
char **argv;
char *prog;
{
+#ifndef USE_CWGUSI
if (prog) {
security(prog);
}
@@ -315,6 +323,9 @@ proc_exec_v(argv, prog)
execv(prog, argv);
after_exec();
return -1;
+#else /* USE_CWGUSI */
+ rb_notimplement();
+#endif /* USE_CWGUSI */
}
static int
@@ -347,6 +358,7 @@ int
rb_proc_exec(str)
char *str;
{
+#ifndef USE_CWGUSI
char *s = str, *t;
char **argv, **a;
@@ -395,6 +407,9 @@ rb_proc_exec(str)
}
errno = ENOENT;
return -1;
+#else /* USE_CWGUSI */
+ rb_notimplement();
+#endif /* USE_CWGUSI */
}
#if defined(__human68k__)
@@ -568,7 +583,11 @@ f_exit_bang(obj, status)
code = INT2FIX(status);
}
+#ifdef USE_CWGUSI
+ exit(code);
+#else
_exit(code);
+#endif
/* not reached */
}
@@ -772,7 +791,7 @@ f_sleep(argc, argv)
return INT2FIX(end);
}
-#if !defined(NT) && !defined(DJGPP) && !defined(__human68k__)
+#if !defined(NT) && !defined(DJGPP) && !defined(__human68k__) && !defined(USE_CWGUSI)
static VALUE
proc_getpgrp(argc, argv)
int argc;
@@ -794,6 +813,7 @@ proc_getpgrp(argc, argv)
return INT2FIX(pgrp);
}
+#ifdef HAVE_SETPGRP
static VALUE
proc_setpgrp(argc, argv)
int argc;
@@ -814,6 +834,7 @@ proc_setpgrp(argc, argv)
#endif
return Qnil;
}
+#endif
#ifdef HAVE_SETPGID
static VALUE
@@ -995,14 +1016,20 @@ extern VALUE f_kill();
void
Init_process()
{
+#ifndef USE_CWGUSI
rb_define_virtual_variable("$$", get_pid, 0);
+#endif
rb_define_readonly_variable("$?", &last_status);
+#ifndef USE_CWGUSI
rb_define_global_function("exec", f_exec, -1);
-#ifndef NT
+#endif
+#if !defined(NT) && !defined(USE_CWGUSI)
rb_define_global_function("fork", f_fork, 0);
#endif
rb_define_global_function("exit!", f_exit_bang, 1);
+#ifndef USE_CWGUSI
rb_define_global_function("system", f_system, -1);
+#endif
rb_define_global_function("sleep", f_sleep, -1);
mProcess = rb_define_module("Process");
@@ -1020,22 +1047,28 @@ Init_process()
#endif
#endif
-#ifndef NT
+#if !defined(NT) && !defined(USE_CWGUSI)
rb_define_singleton_method(mProcess, "fork", f_fork, 0);
#endif
rb_define_singleton_method(mProcess, "exit!", f_exit_bang, 1);
+#ifndef USE_CWGUSI
rb_define_module_function(mProcess, "kill", f_kill, -1);
+#endif
#ifndef NT
rb_define_module_function(mProcess, "wait", f_wait, 0);
rb_define_module_function(mProcess, "waitpid", f_waitpid, 2);
+#ifndef USE_CWGUSI
rb_define_module_function(mProcess, "pid", get_pid, 0);
rb_define_module_function(mProcess, "ppid", get_ppid, 0);
-#endif
+#endif /* ifndef USE_CWGUSI */
+#endif /* ifndef NT */
-#if !defined(NT) && !defined(DJGPP) && !defined(__human68k__)
+#if !defined(NT) && !defined(DJGPP) && !defined(__human68k__) && !defined(USE_CWGUSI)
rb_define_module_function(mProcess, "getpgrp", proc_getpgrp, -1);
+#ifdef HAVE_SETPGRP
rb_define_module_function(mProcess, "setpgrp", proc_setpgrp, -1);
+#endif
#ifdef HAVE_SETPGID
rb_define_module_function(mProcess, "setpgid", proc_setpgid, 2);
#endif
diff --git a/range.c b/range.c
index c9a79d5..fbf6b4a 100644
--- a/range.c
+++ b/range.c
@@ -39,7 +39,7 @@ range_s_new(klass, first, last)
VALUE args[2];
args[0] = first; args[1] = last;
- rb_rescue(range_check, args, range_failed, 0);
+ rb_rescue(range_check, (VALUE)args, range_failed, 0);
obj = obj_alloc(klass);
@@ -111,7 +111,7 @@ range_each(obj)
data.first = b;
data.last = e;
- rb_iterate(range_upto, &data, rb_yield, 0);
+ rb_iterate(range_upto, (VALUE)&data, rb_yield, 0);
}
return Qnil;
diff --git a/regex.c b/regex.c
index adac91d..9b31d5f 100644
--- a/regex.c
+++ b/regex.c
@@ -32,6 +32,10 @@
#include <ctype.h>
#include <sys/types.h>
+#ifdef __MWERKS__
+#include "ruby.h"
+#endif
+
#include "config.h"
#include "defines.h"
diff --git a/ruby.c b/ruby.c
index 8495d6b..60cd9a2 100644
--- a/ruby.c
+++ b/ruby.c
@@ -23,6 +23,17 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+
+#ifdef __MWERKS__
+#include "node.h"
+void show_version();
+void show_copyright();
+#endif
+
+#ifdef USE_CWGUSI
+#include "macruby_missing.h"
+#endif
+
#ifndef HAVE_STRING_H
char *strchr();
char *strrchr();
@@ -73,7 +84,7 @@ extern char *sourcefile;
#define RUBY_SITE_LIB "/usr/local/lib/site_ruby"
#endif
-#if defined(MSDOS) || defined(NT)
+#if defined(MSDOS) || defined(NT) || defined(__MACOS__)
#define RUBY_LIB_SEP ';'
#else
#define RUBY_LIB_SEP ':'
@@ -529,7 +540,9 @@ load_file(fname, script)
argv = origargv;
}
argv[0] = path;
+#ifndef USE_CWGUSI
execv(path, argv);
+#endif
sourcefile = fname;
sourceline = 1;
Fatal("Can't exec %s", path);
@@ -722,6 +735,9 @@ ruby_prog_init()
#if defined(_WIN32) || defined(DJGPP)
addpath(ruby_libpath());
#endif
+#ifdef __MACOS__
+ setup_macruby_libpath();
+#endif
#ifdef RUBY_ARCHLIB
addpath(RUBY_ARCHLIB);
diff --git a/ruby.h b/ruby.h
index 9696030..c6c5403 100644
--- a/ruby.h
+++ b/ruby.h
@@ -13,6 +13,10 @@
#ifndef RUBY_H
#define RUBY_H
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
#include "config.h"
#include "defines.h"
@@ -27,6 +31,10 @@
# include <strings.h>
#endif
+#if defined(__MWERKS__) && defined(__cplusplus)
+# define NEED_PROTO
+#endif
+
#ifndef __STDC__
# define volatile
# ifdef __GNUC__
@@ -34,9 +42,13 @@
# else
# define const
# endif
-# define _(args) ()
#else
+# define NEED_PROTO
+#endif
+#ifdef NEED_PROTO
# define _(args) args
+#else
+# define _(args) ()
#endif
#if defined(HAVE_ALLOCA_H) && !defined(__GNUC__)
@@ -102,11 +114,13 @@ VALUE int2inum _((long));
#define FIXABLE(f) (POSFIXABLE(f) && NEGFIXABLE(f))
/* special contants - i.e. non-zero and non-fixnum constants */
-#undef FALSE
-#undef TRUE
-#define FALSE 0
-#define TRUE 2
-#define NIL 4
+#ifndef MACRUBY_PUBLIC_INTERFACE
+# undef FALSE
+# undef TRUE
+# define FALSE 0
+# define TRUE 2
+# define NIL 4
+#endif
#define Qfalse 0
#define Qtrue 2
#define Qnil 4
@@ -114,7 +128,11 @@ VALUE int2inum _((long));
# define RTEST(v) rb_test_false_or_nil((VALUE)(v))
#define NIL_P(v) ((VALUE)(v) == Qnil)
+#ifdef __MACOS__ /* name conflict, AERegistory.h */
+extern VALUE cRubyObject;
+#else
extern VALUE cObject;
+#endif
VALUE rb_class_of _((VALUE));
#define CLASS_OF(v) rb_class_of((VALUE)(v))
@@ -334,22 +352,36 @@ rb_type(VALUE obj)
{
if (FIXNUM_P(obj)) return T_FIXNUM;
if (obj == Qnil) return T_NIL;
+#ifdef MACRUBY_PUBLIC_INTERFACE
+ if (obj == RubyFALSE) return T_FALSE;
+ if (obj == RubyTRUE) return T_TRUE;
+#else
if (obj == FALSE) return T_FALSE;
if (obj == TRUE) return T_TRUE;
-
+#endif
return BUILTIN_TYPE(obj);
}
extern __inline__ int
rb_special_const_p(VALUE obj)
{
+#ifdef MACRUBY_PUBLIC_INTERFACE
+ return (FIXNUM_P(obj)||obj == Qnil||obj == RubyFALSE||obj == RubyTRUE)?RubyTRUE:RubyFALSE;
+#else
return (FIXNUM_P(obj)||obj == Qnil||obj == FALSE||obj == TRUE)?TRUE:FALSE;
+#endif
}
extern __inline__ int
rb_test_false_or_nil(VALUE v)
{
+#ifdef MACRUBY_PUBLIC_INTERFACE
+ return (v != Qnil) && (v != RubyFALSE);
+ return (v != Qnil) && (v != RubyFALSE);
+#else
+ return (v != Qnil) && (v != FALSE);
return (v != Qnil) && (v != FALSE);
+#endif
}
#else
int rb_type _((VALUE));
@@ -403,8 +435,8 @@ char *rb_class2name _((VALUE));
void rb_p _((VALUE));
VALUE rb_eval_string _((char*));
-VALUE rb_funcall();
-int rb_scan_args();
+VALUE rb_funcall _((VALUE, ID, int, ...));
+int rb_scan_args _((int, VALUE*, char*, ...));
VALUE rb_iv_get _((VALUE, char *));
VALUE rb_iv_set _((VALUE, char *, VALUE));
@@ -419,41 +451,27 @@ extern VALUE verbose, debug;
int rb_safe_level _((void));
void rb_set_safe_level _((int));
-#ifdef __GNUC__
-typedef void voidfn ();
-volatile voidfn Raise;
-volatile voidfn Fail;
-volatile voidfn Fatal;
-volatile voidfn Bug;
-volatile voidfn rb_sys_fail;
-volatile voidfn rb_iter_break;
-volatile voidfn rb_exit;
-volatile voidfn rb_fatal;
-volatile voidfn rb_raise;
-volatile voidfn rb_notimplement;
-#else
-void Raise();
-void Fail();
-void Fatal();
-void Bug();
+void Raise _((VALUE, char*, ...));
+void Fail _((char*, ...));
+void Fatal _((char*, ...));
+void Bug _((char*, ...));
void rb_sys_fail _((char *));
void rb_iter_break _((void));
void rb_exit _((int));
void rb_raise _((VALUE));
void rb_fatal _((VALUE));
void rb_notimplement _((void));
-#endif
-void Error();
-void Warn();
-void Warning(); /* reports if `-w' specified */
+void Error _((char*, ...));
+void Warn _((char*, ...));
+void Warning _((char*, ...)); /* reports if `-w' specified */
VALUE rb_each _((VALUE));
VALUE rb_yield _((VALUE));
int iterator_p _((void));
-VALUE rb_iterate();
-VALUE rb_rescue();
-VALUE rb_ensure();
+VALUE rb_iterate _((VALUE(*)(),VALUE,VALUE(*)(),VALUE));
+VALUE rb_rescue _((VALUE(*)(),VALUE,VALUE(*)(),VALUE));
+VALUE rb_ensure _((VALUE(*)(),VALUE,VALUE(*)(),VALUE));
#include "intern.h"
@@ -463,3 +481,7 @@ static char *libs_to_be_linked[] = { EXTLIB, 0 };
#endif
#endif
+
+#if defined(__cplusplus)
+} /* extern "C" { */
+#endif
diff --git a/signal.c b/signal.c
index 22c33d2..ac444bb 100644
--- a/signal.c
+++ b/signal.c
@@ -13,12 +13,21 @@
#include <signal.h>
#include <stdio.h>
+#ifdef __BEOS__
+#undef SIGBUS
+#endif
+
#ifndef NSIG
-#ifdef DJGPP
-#define NSIG SIGMAX
-#else
-#define NSIG (_SIGMAX + 1) /* For QNX */
+# ifdef DJGPP
+# define NSIG SIGMAX
+# else
+# define NSIG (_SIGMAX + 1) /* For QNX */
+# endif
#endif
+
+#ifdef USE_CWGUSI
+# undef NSIG
+# define NSIG __signal_max
#endif
static struct signals {
@@ -175,6 +184,9 @@ f_kill(argc, argv)
int argc;
VALUE *argv;
{
+#ifdef USE_CWGUSI
+ rb_notimplement();
+#else
int sig;
int i;
char *s;
@@ -237,6 +249,7 @@ f_kill(argc, argv)
}
}
return INT2FIX(i-1);
+#endif /* USE_CWGUSI */
}
static VALUE trap_list[NSIG];
@@ -248,12 +261,14 @@ int prohibit_interrupt;
void
gc_mark_trap_list()
{
+#ifndef MACOS_UNUSE_SIGNAL
int i;
for (i=0; i<NSIG; i++) {
if (trap_list[i])
gc_mark(trap_list[i]);
}
+#endif /* MACOS_UNUSE_SIGNAL */
}
#ifdef POSIX_SIGNAL
@@ -322,13 +337,16 @@ sigsegv(sig)
void
rb_trap_exit()
{
+#ifndef MACOS_UNUSE_SIGNAL
if (trap_list[0])
rb_eval_cmd(trap_list[0], ary_new3(1, INT2FIX(0)));
+#endif
}
void
rb_trap_exec()
{
+#ifndef MACOS_UNUSE_SIGNAL
int i;
for (i=0; i<NSIG; i++) {
@@ -341,11 +359,12 @@ rb_trap_exec()
rb_trap_eval(trap_list[i], i);
}
}
+#endif /* MACOS_UNUSE_SIGNAL */
trap_pending = 0;
}
struct trap_arg {
-#ifndef NT
+#if !defined(NT) && !defined(USE_CWGUSI)
# ifdef HAVE_SIGPROCMASK
sigset_t mask;
# else
@@ -458,7 +477,7 @@ trap(arg)
trap_list[sig] = command;
/* enable at least specified signal. */
-#ifndef NT
+#if !defined(NT) && !defined(USE_CWGUSI)
#ifdef HAVE_SIGPROCMASK
sigdelset(&arg->mask, sig);
#else
@@ -468,8 +487,8 @@ trap(arg)
return old;
}
-#ifndef NT
-static void
+#if !defined(NT) && !defined(USE_CWGUSI)
+static VALUE
trap_ensure(arg)
struct trap_arg *arg;
{
@@ -515,7 +534,7 @@ f_trap(argc, argv)
arg.cmd = argv[1];
}
-#ifndef NT
+#if !defined(NT) && !defined(USE_CWGUSI)
/* disable interrupt */
# ifdef HAVE_SIGPROCMASK
sigfillset(&arg.mask);
@@ -524,7 +543,7 @@ f_trap(argc, argv)
arg.mask = sigblock(~0);
# endif
- return rb_ensure(trap, &arg, trap_ensure, &arg);
+ return rb_ensure(trap, (VALUE)&arg, trap_ensure, (VALUE)&arg);
#else
return trap(&arg);
#endif
@@ -533,6 +552,7 @@ f_trap(argc, argv)
void
Init_signal()
{
+#ifndef MACOS_UNUSE_SIGNAL
extern VALUE mKernel;
rb_define_global_function("trap", f_trap, -1);
@@ -547,4 +567,5 @@ Init_signal()
#ifdef SIGSEGV
signal(SIGSEGV, sigsegv);
#endif
+#endif /* MACOS_UNUSE_SIGNAL */
}
diff --git a/st.c b/st.c
index 6b25bc8..27ccf3e 100644
--- a/st.c
+++ b/st.c
@@ -6,6 +6,10 @@ static char sccsid[] = "@(#) st.c 5.1 89/12/14 Crucible";
#include <stdio.h>
#include "st.h"
+#ifdef USE_CWGUSI
+#include <stdlib.h>
+#endif
+
#define ST_DEFAULT_MAX_DENSITY 5
#define ST_DEFAULT_INIT_TABLE_SIZE 11
diff --git a/string.c b/string.c
index 15be9d0..7c232e2 100644
--- a/string.c
+++ b/string.c
@@ -29,8 +29,6 @@ VALUE cString;
#define STR_FREEZE FL_USER1
#define STR_TAINT FL_USER2
#define STR_NO_ORIG FL_USER3
-void reg_prepare_re _((VALUE));
-void kcode_reset_option _((void));
extern VALUE RS;
diff --git a/struct.c b/struct.c
index 6c581f4..a7ed262 100644
--- a/struct.c
+++ b/struct.c
@@ -10,6 +10,10 @@
#include "ruby.h"
+#ifdef USE_CWGUSI
+#include <stdio.h>
+#endif
+
ID rb_frame_last_func();
VALUE cStruct;
extern VALUE mEnumerable;
@@ -161,12 +165,22 @@ make_struct(name, member, klass)
return nstr;
}
+#ifdef __STDC__
+#include <stdarg.h>
+#define va_init_list(a,b) va_start(a,b)
+#else
#include <varargs.h>
+#define va_init_list(a,b) va_start(a)
+#endif
VALUE
+#ifdef __STDC__
+struct_define(char *name, ...)
+#else
struct_define(name, va_alist)
char *name;
va_dcl
+#endif
{
va_list ar;
VALUE nm, ary;
@@ -175,7 +189,7 @@ struct_define(name, va_alist)
nm = str_new2(name);
ary = ary_new();
- va_start(ar);
+ va_init_list(ar, name);
while (mem = va_arg(ar, char*)) {
ID slot = rb_intern(mem);
ary_push(ary, INT2FIX(slot));
@@ -235,9 +249,13 @@ struct_alloc(klass, values)
}
VALUE
+#ifdef __STDC__
+struct_new(VALUE klass, ...)
+#else
struct_new(klass, va_alist)
VALUE klass;
va_dcl
+#endif
{
VALUE val, mem;
int size;
@@ -246,7 +264,7 @@ struct_new(klass, va_alist)
val = rb_iv_get(klass, "__size__");
size = FIX2INT(val);
mem = ary_new();
- va_start(args);
+ va_init_list(args, klass);
while (size--) {
val = va_arg(args, VALUE);
ary_push(mem, val);
diff --git a/time.c b/time.c
index 5cb4087..19ee715 100644
--- a/time.c
+++ b/time.c
@@ -13,6 +13,11 @@
#include "ruby.h"
#include <sys/types.h>
+#ifdef USE_CWGUSI
+int gettimeofday(struct timeval*, struct timezone*);
+int strcasecmp(char*, char*);
+#endif
+
#include <time.h>
#ifndef NT
#ifdef HAVE_SYS_TIME_H
diff --git a/variable.c b/variable.c
index 099476c..381cad4 100644
--- a/variable.c
+++ b/variable.c
@@ -13,6 +13,10 @@
#include "node.h"
#include "st.h"
+#ifdef USE_CWGUSI
+char* strdup(char*);
+#endif
+
static st_table *rb_global_tbl;
st_table *rb_class_tbl;
#define global_tbl rb_global_tbl
@@ -590,7 +594,7 @@ struct trace_data {
VALUE val;
};
-static void
+static VALUE
trace_ev(data)
struct trace_data *data;
{
@@ -602,7 +606,7 @@ trace_ev(data)
}
}
-static void
+static VALUE
trace_en(entry)
struct global_entry *entry;
{
@@ -627,7 +631,7 @@ rb_gvar_set(entry, val)
entry->block_trace = 1;
trace.trace = entry->trace;
trace.val = val;
- rb_ensure(trace_ev, &trace, trace_en, entry);
+ rb_ensure(trace_ev, (VALUE)&trace, trace_en, (VALUE)entry);
}
return val;
}
diff --git a/version.h b/version.h
index 5a83c3f..6d2eb39 100644
--- a/version.h
+++ b/version.h
@@ -1,2 +1,2 @@
-#define RUBY_VERSION "1.1b9_18"
-#define VERSION_DATE "98/05/12"
+#define RUBY_VERSION "1.1b9_19"
+#define VERSION_DATE "98/05/13"