summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-04 13:42:00 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-04 13:42:00 +0000
commit642e08187927b2debaa0d84a112123043f0f7912 (patch)
treeb7023daf3123ff37d9095bd0f19931c5bc58de56
parentae7ea3332b07c83ee050c88cd902070689fd582f (diff)
* dln.c: Ruby no longer supports MacOS 9 or before.
* eval.c: ditto. * eval_intern.h: ditto. * ext/extmk.rb: ditto. * ext/tk/sample/tkextlib/treectrl/demo.rb: ditto. * ext/tk/stubs.c: ditto. * file.c: ditto. * hash.c: ditto. * include/ruby/defines.h: ditto. * ruby.c: ditto. * signal.c: ditto. * vm_core.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog26
-rw-r--r--dln.c86
-rw-r--r--eval.c10
-rw-r--r--eval_intern.h4
-rw-r--r--ext/extmk.rb2
-rw-r--r--ext/tk/sample/tkextlib/treectrl/demo.rb8
-rw-r--r--ext/tk/stubs.c33
-rw-r--r--file.c19
-rw-r--r--hash.c5
-rw-r--r--include/ruby/defines.h2
-rw-r--r--ruby.c6
-rw-r--r--signal.c5
-rw-r--r--vm_core.h6
13 files changed, 32 insertions, 180 deletions
diff --git a/ChangeLog b/ChangeLog
index aa9e6b1d9d..0d5ecf04b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+Sat Oct 4 22:35:06 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
+
+ * dln.c: Ruby no longer supports MacOS 9 or before.
+
+ * eval.c: ditto.
+
+ * eval_intern.h: ditto.
+
+ * ext/extmk.rb: ditto.
+
+ * ext/tk/sample/tkextlib/treectrl/demo.rb: ditto.
+
+ * ext/tk/stubs.c: ditto.
+
+ * file.c: ditto.
+
+ * hash.c: ditto.
+
+ * include/ruby/defines.h: ditto.
+
+ * ruby.c: ditto.
+
+ * signal.c: ditto.
+
+ * vm_core.h: ditto.
+
Sat Oct 4 22:30:28 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* dln.c: Ruby no longer supports MS-DOS.
diff --git a/dln.c b/dln.c
index 4be1e006fb..04cd0612fb 100644
--- a/dln.c
+++ b/dln.c
@@ -75,13 +75,6 @@ char *getenv();
#include <dlfcn.h>
#endif
-#ifdef __MACOS__
-# include <TextUtils.h>
-# include <CodeFragments.h>
-# include <Aliases.h>
-# include "macruby_private.h"
-#endif
-
#if defined(__APPLE__) && defined(__MACH__) /* Mac OS X */
# if defined(HAVE_DLOPEN)
/* Mac OS X with dlopen (10.3 or later) */
@@ -119,11 +112,7 @@ init_funcname_len(char **buf, const char *file)
/* Load the file as an object one */
for (slash = file-1; *file; file++) /* Find position of last '/' */
-#ifdef __MACOS__
- if (*file == ':') slash = file;
-#else
if (*file == '/') slash = file;
-#endif
len = strlen(FUNCNAME_PATTERN) + strlen(slash + 1);
*buf = xmalloc(len);
@@ -1480,53 +1469,6 @@ dln_load(const char *file)
}
#endif /* __BEOS__*/
-#ifdef __MACOS__ /* Mac OS 9 or before */
-# 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];
-
- 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) {
- rb_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);
- rb_loaderror("%s - %s",errMessage , file);
- }
-
- /* Locate the address of the correct init function */
- c2pstr(buf);
- err = FindSymbol(connID, buf, &symAddr, &class);
- if (err) {
- rb_loaderror("Unresolved symbols - %s" , file);
- }
- init_fct = (void (*)())symAddr;
- (*init_fct)();
- return (void*)init_fct;
- }
-#endif /* __MACOS__ */
-
#if defined(__VMS)
#define DLN_DEFINED
{
@@ -1581,7 +1523,7 @@ dln_find_exe_r(const char *fname, const char *path, char *buf, int size)
}
if (!path) {
-#if defined(_WIN32) || defined(__MACOS__)
+#if defined(_WIN32)
path = "/usr/local/bin;/usr/ucb;/usr/bin;/bin;.";
#else
path = "/usr/local/bin:/usr/ucb:/usr/bin:/bin:.";
@@ -1593,13 +1535,8 @@ dln_find_exe_r(const char *fname, const char *path, char *buf, int size)
char *
dln_find_file_r(const char *fname, const char *path, char *buf, int size)
{
-#ifndef __MACOS__
if (!path) path = ".";
return dln_find_1(fname, path, buf, size, 0);
-#else
- if (!path) path = ".";
- return _macruby_path_conv_posix_to_macos(dln_find_1(fname, path, buf, size, 0));
-#endif
}
static char fbuf[MAXPATHLEN];
@@ -1624,9 +1561,6 @@ dln_find_1(const char *fname, const char *path, char *fbuf, int size,
register const char *ep;
register char *bp;
struct stat st;
-#ifdef __MACOS__
- const char* mac_fullpath;
-#endif
#define RETURN_IF(expr) if (expr) return (char *)fname;
@@ -1728,37 +1662,19 @@ dln_find_1(const char *fname, const char *path, char *fbuf, int size,
continue;
}
strcpy(bp + i, extension[j]);
-#ifndef __MACOS__
if (stat(fbuf, &st) == 0)
return fbuf;
-#else
- if (mac_fullpath = _macruby_exist_file_in_libdir_as_posix_name(fbuf))
- return mac_fullpath;
-
-#endif
}
goto next;
}
#endif /* _WIN32 or __EMX__ */
-#ifndef __MACOS__
if (stat(fbuf, &st) == 0) {
if (exe_flag == 0) return fbuf;
/* looking for executable */
if (!S_ISDIR(st.st_mode) && eaccess(fbuf, X_OK) == 0)
return fbuf;
}
-#else
- if (mac_fullpath = _macruby_exist_file_in_libdir_as_posix_name(fbuf)) {
- if (exe_flag == 0) return mac_fullpath;
- /* looking for executable */
- if (stat(mac_fullpath, &st) == 0) {
- if (!S_ISDIR(st.st_mode) && eaccess(mac_fullpath, X_OK) == 0)
- return mac_fullpath;
- }
- }
-#endif
-
next:
/* if not, and no other alternatives, life is bleak */
if (*ep == '\0') {
diff --git a/eval.c b/eval.c
index 8b39e42679..fcd295e6b6 100644
--- a/eval.c
+++ b/eval.c
@@ -31,7 +31,7 @@ VALUE rb_eSysStackError;
#if defined(__APPLE__)
#define environ (*_NSGetEnviron())
-#elif !defined(_WIN32) && !defined(__MACOS__) || defined(_WIN32_WCE)
+#elif !defined(_WIN32) && defined(_WIN32_WCE)
extern char **environ;
#endif
char **rb_origenviron;
@@ -54,11 +54,7 @@ ruby_init(void)
return;
initialized = 1;
-#ifdef __MACOS__
- rb_origenviron = 0;
-#else
rb_origenviron = environ;
-#endif
Init_stack((void *)&state);
Init_BareVM();
@@ -68,9 +64,7 @@ ruby_init(void)
if ((state = EXEC_TAG()) == 0) {
rb_call_inits();
-#ifdef __MACOS__
- _macruby_init();
-#elif defined(__VMS)
+#if defined(__VMS)
_vmsruby_init();
#endif
diff --git a/eval_intern.h b/eval_intern.h
index a961e8af04..17d0669a55 100644
--- a/eval_intern.h
+++ b/eval_intern.h
@@ -64,10 +64,6 @@ char *strrchr(const char *, const char);
#include <net/socket.h>
#endif
-#ifdef __MACOS__
-#include "macruby_private.h"
-#endif
-
#ifdef __VMS
#include "vmsruby_private.h"
#endif
diff --git a/ext/extmk.rb b/ext/extmk.rb
index a461b1d25f..ac497bbf20 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -39,7 +39,7 @@ load File.expand_path("lib/mkmf.rb", srcdir)
require 'optparse/shellwords'
def sysquote(x)
- @quote ||= /os2|macos/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
+ @quote ||= /os2/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
@quote ? x.quote : x
end
diff --git a/ext/tk/sample/tkextlib/treectrl/demo.rb b/ext/tk/sample/tkextlib/treectrl/demo.rb
index eed95d0e1c..a1b4661197 100644
--- a/ext/tk/sample/tkextlib/treectrl/demo.rb
+++ b/ext/tk/sample/tkextlib/treectrl/demo.rb
@@ -156,8 +156,6 @@ class TkTreeCtrl_demo
@src_top = TkToplevel.new
f = TkFrame.new(@src_top, :borderwidth=>0)
case @thisPlatform
- when 'macintosh', 'macos'
- font = TkFont.new(['Geneva', 9])
when 'unix'
font = TkFont.new(['Courier', -12])
else
@@ -198,10 +196,6 @@ class TkTreeCtrl_demo
def tree_plus_scrollbars_in_a_frame(parent, h, v)
f = TkFrame.new(parent, :borderwidth=>1, :relief=>:sunken)
case @thisPlatform
- when 'macintosh'
- font = TkFont.new(['Geneva', 9])
- when 'macos'
- font = TkFont.new(['Lucida Grande', 11])
when 'unix'
font = TkFont.new(['Helvetica', -12])
else
@@ -244,7 +238,7 @@ class TkTreeCtrl_demo
Tk.root.title('Tk::TreeCtrl Demo')
case @thisPlatform
- when 'macintosh', 'macosx'
+ when 'macosx'
Tk.root.geometry('+40+40')
else
Tk.root.geometry('+0+30')
diff --git a/ext/tk/stubs.c b/ext/tk/stubs.c
index 4388fb294d..e7ef79dda8 100644
--- a/ext/tk/stubs.c
+++ b/ext/tk/stubs.c
@@ -11,25 +11,6 @@
/*------------------------------*/
-#ifdef __MACOS__
-# include <tkMac.h>
-# include <Quickdraw.h>
-
-static int call_macinit = 0;
-
-static void
-_macinit()
-{
- if (!call_macinit) {
- tcl_macQdPtr = &qd; /* setup QuickDraw globals */
- Tcl_MacSetEventProc(TkMacConvertEvent); /* setup event handler */
- call_macinit = 1;
- }
-}
-#endif
-
-/*------------------------------*/
-
static int nativethread_checked = 0;
static void
@@ -320,10 +301,6 @@ ruby_tk_stubs_init(tcl_ip)
if (!Tk_InitStubs(tcl_ip, (char *)"8.1", 0))
return FAIL_Tk_InitStubs;
-
-#ifdef __MACOS__
- _macinit();
-#endif
}
return TCLTK_STUBS_OK;
@@ -359,10 +336,6 @@ ruby_tk_stubs_safeinit(tcl_ip)
if (!Tk_InitStubs(tcl_ip, (char *)"8.1", 0))
return FAIL_Tk_InitStubs;
-
-#ifdef __MACOS__
- _macinit();
-#endif
}
return TCLTK_STUBS_OK;
@@ -517,9 +490,6 @@ ruby_tk_stubs_init(tcl_ip)
return FAIL_Tk_Init;
if (!call_tk_stubs_init) {
-#ifdef __MACOS__
- _macinit();
-#endif
call_tk_stubs_init = 1;
}
@@ -539,9 +509,6 @@ ruby_tk_stubs_safeinit(tcl_ip)
return FAIL_Tk_Init;
if (!call_tk_stubs_init) {
-#ifdef __MACOS__
- _macinit();
-#endif
call_tk_stubs_init = 1;
}
diff --git a/file.c b/file.c
index 415c866eca..21f74f0129 100644
--- a/file.c
+++ b/file.c
@@ -4468,15 +4468,6 @@ rb_path_check(const char *path)
return 1;
}
-#if defined(__MACOS__) || defined(riscos)
-static int
-is_macos_native_path(const char *path)
-{
- if (strchr(path, ':')) return 1;
- return 0;
-}
-#endif
-
static int
file_load_ok(const char *path)
{
@@ -4571,16 +4562,6 @@ rb_find_file(VALUE path)
f = StringValueCStr(path);
}
-#if defined(__MACOS__) || defined(riscos)
- if (is_macos_native_path(f)) {
- if (rb_safe_level() >= 1 && !fpath_check(f)) {
- rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
- }
- if (file_load_ok(f)) return path;
- return 0;
- }
-#endif
-
if (is_absolute_path(f) || is_explicit_relative(f)) {
if (rb_safe_level() >= 1 && !fpath_check(f)) {
rb_raise(rb_eSecurityError, "loading from unsafe file %s", f);
diff --git a/hash.c b/hash.c
index 41836ea6a9..044964c809 100644
--- a/hash.c
+++ b/hash.c
@@ -2640,7 +2640,6 @@ Init_Hash(void)
rb_define_method(rb_cHash,"compare_by_identity", rb_hash_compare_by_id, 0);
rb_define_method(rb_cHash,"compare_by_identity?", rb_hash_compare_by_id_p, 0);
-#ifndef __MACOS__ /* environment variables nothing on MacOS. */
origenviron = environ;
envtbl = rb_obj_alloc(rb_cObject);
rb_extend_object(envtbl, rb_mEnumerable);
@@ -2686,8 +2685,4 @@ Init_Hash(void)
rb_define_singleton_method(envtbl,"rassoc", env_rassoc, 1);
rb_define_global_const("ENV", envtbl);
-#else /* __MACOS__ */
- envtbl = rb_hash_s_new(0, NULL, rb_cHash);
- rb_define_global_const("ENV", envtbl);
-#endif /* ifndef __MACOS__ environment variables nothing on MacOS. */
}
diff --git a/include/ruby/defines.h b/include/ruby/defines.h
index acd01d862a..6a171d6231 100644
--- a/include/ruby/defines.h
+++ b/include/ruby/defines.h
@@ -245,8 +245,6 @@ void rb_ia64_flushrs(void);
#if defined(DOSISH)
#define PATH_SEP ";"
-#elif defined(riscos)
-#define PATH_SEP ","
#else
#define PATH_SEP ":"
#endif
diff --git a/ruby.c b/ruby.c
index d326ca272e..d04d6860f2 100644
--- a/ruby.c
+++ b/ruby.c
@@ -46,10 +46,6 @@
# define MAXPATHLEN 1024
#endif
-#if defined(__MACOS__) && defined(__MWERKS__)
-#include <console.h>
-#endif
-
#include "ruby/util.h"
#ifndef HAVE_STDLIB_H
@@ -1554,8 +1550,6 @@ ruby_sysinit(int *argc, char ***argv)
}
v2[n] = 0;
*argv = v2;
-#elif defined(__MACOS__) && defined(__MWERKS__)
- *argc = ccommand(argv);
#elif defined(_WIN32)
void rb_w32_sysinit(int *argc, char ***argv);
rb_w32_sysinit(argc, argv);
diff --git a/signal.c b/signal.c
index a2bd3f5d48..e99a5eb73a 100644
--- a/signal.c
+++ b/signal.c
@@ -298,10 +298,8 @@ interrupt_init(int argc, VALUE *argv, VALUE self)
void
ruby_default_signal(int sig)
{
-#ifndef MACOS_UNUSE_SIGNAL
signal(sig, SIG_DFL);
raise(sig);
-#endif
}
/*
@@ -1033,7 +1031,6 @@ int ruby_enable_coredump = 0;
void
Init_signal(void)
{
-#ifndef MACOS_UNUSE_SIGNAL
VALUE mSignal = rb_define_module("Signal");
rb_define_global_function("trap", sig_trap, -1);
@@ -1085,6 +1082,4 @@ Init_signal(void)
#elif defined(SIGCHLD)
init_sigchld(SIGCHLD);
#endif
-
-#endif /* MACOS_UNUSE_SIGNAL */
}
diff --git a/vm_core.h b/vm_core.h
index 5975a72c1b..27af51dd57 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -35,11 +35,7 @@
#include <signal.h>
#ifndef NSIG
-# if defined MACOS_UNUSE_SIGNAL
-# define NSIG 1
-# else
-# define NSIG (_SIGMAX + 1) /* For QNX */
-# endif
+# define NSIG (_SIGMAX + 1) /* For QNX */
#endif
#define RUBY_NSIG NSIG