[前][次][番号順一覧][スレッド一覧]

ruby-changes:8152

From: yugui <ko1@a...>
Date: Sat, 4 Oct 2008 22:42:20 +0900 (JST)
Subject: [ruby-changes:8152] Ruby:r19680 (trunk): * dln.c: Ruby no longer supports MacOS 9 or before.

yugui	2008-10-04 22:42:00 +0900 (Sat, 04 Oct 2008)

  New Revision: 19680

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19680

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/dln.c
    trunk/eval.c
    trunk/eval_intern.h
    trunk/ext/extmk.rb
    trunk/ext/tk/sample/tkextlib/treectrl/demo.rb
    trunk/ext/tk/stubs.c
    trunk/file.c
    trunk/hash.c
    trunk/include/ruby/defines.h
    trunk/ruby.c
    trunk/signal.c
    trunk/vm_core.h

Index: eval_intern.h
===================================================================
--- eval_intern.h	(revision 19679)
+++ eval_intern.h	(revision 19680)
@@ -64,10 +64,6 @@
 #include <net/socket.h>
 #endif
 
-#ifdef __MACOS__
-#include "macruby_private.h"
-#endif
-
 #ifdef __VMS
 #include "vmsruby_private.h"
 #endif
Index: include/ruby/defines.h
===================================================================
--- include/ruby/defines.h	(revision 19679)
+++ include/ruby/defines.h	(revision 19680)
@@ -245,8 +245,6 @@
 
 #if defined(DOSISH)
 #define PATH_SEP ";"
-#elif defined(riscos)
-#define PATH_SEP ","
 #else
 #define PATH_SEP ":"
 #endif
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 19679)
+++ ChangeLog	(revision 19680)
@@ -1,3 +1,29 @@
+Sat Oct  4 22:35:06 2008  Yuki Sonoda (Yugui)  <yugui@y...>
+
+	* 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@y...>
 
 	* dln.c: Ruby no longer supports MS-DOS.
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 19679)
+++ vm_core.h	(revision 19680)
@@ -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
Index: eval.c
===================================================================
--- eval.c	(revision 19679)
+++ eval.c	(revision 19680)
@@ -31,7 +31,7 @@
 
 #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 @@
 	return;
     initialized = 1;
 
-#ifdef __MACOS__
-    rb_origenviron = 0;
-#else
     rb_origenviron = environ;
-#endif
 
     Init_stack((void *)&state);
     Init_BareVM();
@@ -68,9 +64,7 @@
     if ((state = EXEC_TAG()) == 0) {
 	rb_call_inits();
 
-#ifdef __MACOS__
-	_macruby_init();
-#elif defined(__VMS)
+#if defined(__VMS)
 	_vmsruby_init();
 #endif
 
Index: dln.c
===================================================================
--- dln.c	(revision 19679)
+++ dln.c	(revision 19680)
@@ -75,13 +75,6 @@
 #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 @@
 
     /* 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 @@
     }
 #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 @@
     }
 
     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 @@
 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 @@
     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 @@
 		    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') {
Index: ext/tk/stubs.c
===================================================================
--- ext/tk/stubs.c	(revision 19679)
+++ ext/tk/stubs.c	(revision 19680)
@@ -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 @@
 
         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 @@
 
         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 @@
         return FAIL_Tk_Init;
 
     if (!call_tk_stubs_init) {
-#ifdef __MACOS__
-        _macinit();
-#endif
         call_tk_stubs_init = 1;
     }
 
@@ -539,9 +509,6 @@
         return FAIL_Tk_Init;
 
     if (!call_tk_stubs_init) {
-#ifdef __MACOS__
-        _macinit();
-#endif
         call_tk_stubs_init = 1;
     }
 
Index: ext/tk/sample/tkextlib/treectrl/demo.rb
===================================================================
--- ext/tk/sample/tkextlib/treectrl/demo.rb	(revision 19679)
+++ ext/tk/sample/tkextlib/treectrl/demo.rb	(revision 19680)
@@ -156,8 +156,6 @@
     @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 @@
   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 @@
     Tk.root.title('Tk::TreeCtrl Demo')
 
     case @thisPlatform
-    when 'macintosh', 'macosx'
+    when 'macosx'
       Tk.root.geometry('+40+40')
     else
       Tk.root.geometry('+0+30')
Index: ext/extmk.rb
===================================================================
--- ext/extmk.rb	(revision 19679)
+++ ext/extmk.rb	(revision 19680)
@@ -39,7 +39,7 @@
 require 'optparse/shellwords'
 
 def sysquote(x)
-  @quote ||= /os2|macos/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
+  @quote ||= /os2/ =~ (CROSS_COMPILING || RUBY_PLATFORM)
   @quote ? x.quote : x
 end
 
Index: hash.c
===================================================================
--- hash.c	(revision 19679)
+++ hash.c	(revision 19680)
@@ -2640,7 +2640,6 @@
     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 @@
     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. */
 }
Index: ruby.c
===================================================================
--- ruby.c	(revision 19679)
+++ ruby.c	(revision 19680)
@@ -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 @@
     }
     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);
Index: signal.c
===================================================================
--- signal.c	(revision 19679)
+++ signal.c	(revision 19680)
@@ -298,10 +298,8 @@
 void
 ruby_default_signal(int sig)
 {
-#ifndef MACOS_UNUSE_SIGNAL
     signal(sig, SIG_DFL);
     raise(sig);
-#endif
 }
 
 /*
@@ -1033,7 +1031,6 @@
 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 @@
 #elif defined(SIGCHLD)
     init_sigchld(SIGCHLD);
 #endif
-
-#endif /* MACOS_UNUSE_SIGNAL */
 }
Index: file.c
===================================================================
--- file.c	(revision 19679)
+++ file.c	(revision 19680)
@@ -4468,16 +4468,7 @@
     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)
 {
     return eaccess(path, R_OK) == 0;
@@ -4571,16 +4562,6 @@
 	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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]