ruby-changes:8150
From: yugui <ko1@a...>
Date: Sat, 4 Oct 2008 22:25:39 +0900 (JST)
Subject: [ruby-changes:8150] Ruby:r19678 (trunk): * djgpp/GNUmakefile.in: removed. Ruby no longer supports djgpp.
yugui 2008-10-04 22:25:12 +0900 (Sat, 04 Oct 2008) New Revision: 19678 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19678 Log: * djgpp/GNUmakefile.in: removed. Ruby no longer supports djgpp. * djgpp/README.djgpp: ditto. * djgpp/config.hin: ditto. * djgpp/config.sed: ditto. * djgpp/configure.bat: ditto. * djgpp/mkver.sed: ditto. * ext/Setup.dj: ditto. * dln.c: removed djgpp supports. * file.c: ditto. * gc.c: ditto. * io.c: ditto. * process.c: ditto. * ruby.c: ditto. * signal.c: ditto. * util.c: ditto. * vm_core.h: ditto. * lib/fileutils.rb: ditto. * lib/mkmf.rb: ditto. * ext/socket/socket.c: ditto. * test/fileutils/test_fileutils.rb: ditto. * test/ruby/test_env.rb: ditto. * test/ruby/test_path.rb: ditto. Removed directories: trunk/djgpp/ Removed files: trunk/ext/Setup.dj Modified files: trunk/ChangeLog trunk/dln.c trunk/ext/socket/socket.c trunk/file.c trunk/gc.c trunk/io.c trunk/lib/fileutils.rb trunk/lib/mkmf.rb trunk/process.c trunk/ruby.c trunk/signal.c trunk/test/fileutils/test_fileutils.rb trunk/test/ruby/test_env.rb trunk/test/ruby/test_path.rb trunk/util.c trunk/vm_core.h Index: ChangeLog =================================================================== --- ChangeLog (revision 19677) +++ ChangeLog (revision 19678) @@ -1,3 +1,49 @@ +Sat Oct 4 22:14:15 2008 Yuki Sonoda (Yugui) <yugui@y...> + + * djgpp/GNUmakefile.in: removed. Ruby no longer supports djgpp. + + * djgpp/README.djgpp: ditto. + + * djgpp/config.hin: ditto. + + * djgpp/config.sed: ditto. + + * djgpp/configure.bat: ditto. + + * djgpp/mkver.sed: ditto. + + * ext/Setup.dj: ditto. + + * dln.c: removed djgpp supports. + + * file.c: ditto. + + * gc.c: ditto. + + * io.c: ditto. + + * process.c: ditto. + + * ruby.c: ditto. + + * signal.c: ditto. + + * util.c: ditto. + + * vm_core.h: ditto. + + * lib/fileutils.rb: ditto. + + * lib/mkmf.rb: ditto. + + * ext/socket/socket.c: ditto. + + * test/fileutils/test_fileutils.rb: ditto. + + * test/ruby/test_env.rb: ditto. + + * test/ruby/test_path.rb: ditto. + Sat Oct 4 21:59:39 2008 Yuki Sonoda (Yugui) <yugui@y...> * x68/_dtos18.c: removed. Ruby no longer supports human68k. Index: vm_core.h =================================================================== --- vm_core.h (revision 19677) +++ vm_core.h (revision 19678) @@ -35,9 +35,7 @@ #include <signal.h> #ifndef NSIG -# ifdef DJGPP -# define NSIG SIGMAX -# elif defined MACOS_UNUSE_SIGNAL +# if defined MACOS_UNUSE_SIGNAL # define NSIG 1 # else # define NSIG (_SIGMAX + 1) /* For QNX */ Index: io.c =================================================================== --- io.c (revision 19677) +++ io.c (revision 19678) @@ -46,7 +46,7 @@ #endif #include <sys/types.h> -#if defined(HAVE_SYS_IOCTL_H) && !defined(DJGPP) && !defined(_WIN32) +#if defined(HAVE_SYS_IOCTL_H) && !defined(_WIN32) #include <sys/ioctl.h> #endif #if defined(HAVE_FCNTL_H) || defined(_WIN32) @@ -4195,9 +4195,6 @@ } fptr->fd = -1; fptr->stdio_file = 0; -#if defined DJGPP - status <<= 8; -#endif rb_last_status_set(status, fptr->pid); #else fptr_finalize(fptr, noraise); @@ -8418,7 +8415,7 @@ rb_define_hooked_variable("$-i", &argf, opt_i_get, opt_i_set); rb_define_hooked_variable("$*", &argf, argf_argv_getter, 0); -#if defined (_WIN32) || defined(DJGPP) || defined(__CYGWIN__) +#if defined (_WIN32) || defined(__CYGWIN__) atexit(pipe_atexit); #endif Index: lib/fileutils.rb =================================================================== --- lib/fileutils.rb (revision 19677) +++ lib/fileutils.rb (revision 19678) @@ -524,7 +524,7 @@ OPT_TABLE['move'] = [:force, :noop, :verbose, :secure] def rename_cannot_overwrite_file? #:nodoc: - /djgpp|cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM + /cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM end private_module_function :rename_cannot_overwrite_file? Index: lib/mkmf.rb =================================================================== --- lib/mkmf.rb (revision 19677) +++ lib/mkmf.rb (revision 19678) @@ -9,7 +9,7 @@ ORIG_LIBPATH = ENV['LIB'] CXX_EXT = %w[cc cxx cpp] -if /mswin|bccwin|mingw|msdosdjgpp|os2/ !~ CONFIG['build_os'] +if /mswin|bccwin|mingw|os2/ !~ CONFIG['build_os'] CXX_EXT.concat(%w[C]) end SRC_EXT = %w[c m] << CXX_EXT @@ -1299,7 +1299,7 @@ if CONFIG['target_os'] != 'cygwin' vpath = vpath.map {|p| p.sub(/.*/, '$(shell cygpath -u \&)')} end - when 'msdosdjgpp', 'mingw32' + when 'mingw32' CONFIG['PATH_SEPARATOR'] = ';' end end Index: gc.c =================================================================== --- gc.c (revision 19677) +++ gc.c (revision 19678) @@ -1858,31 +1858,6 @@ return 0; } -#ifdef __GNUC__ -#if defined(DJGPP) -#undef rb_setjmp -#undef rb_jmp_buf -#if defined(DJGPP) -typedef unsigned long rb_jmp_buf[6]; -__asm__ (".align 4\n\ -_rb_setjmp:\n\ - pushl %ebp\n\ - movl %esp,%ebp\n\ - movl 8(%ebp),%ebp\n\ - movl %eax,(%ebp)\n\ - movl %ebx,4(%ebp)\n\ - movl %ecx,8(%ebp)\n\ - movl %edx,12(%ebp)\n\ - movl %esi,16(%ebp)\n\ - movl %edi,20(%ebp)\n\ - popl %ebp\n\ - xorl %eax,%eax\n\ - ret"); -#endif -int rb_setjmp (rb_jmp_buf); -#endif /* DJGPP */ -#endif /* __GNUC__ */ - #define GC_NOTIFY 0 void rb_vm_mark(void *ptr); Index: dln.c =================================================================== --- dln.c (revision 19677) +++ dln.c (revision 19678) @@ -1715,9 +1715,6 @@ static const char extension[][5] = { #if defined(MSDOS) ".com", ".exe", ".bat", -#if defined(DJGPP) - ".btm", ".sh", ".ksh", ".pl", ".sed", -#endif #elif defined(__EMX__) || defined(_WIN32) ".exe", ".com", ".cmd", ".bat", /* end of __EMX__ or _WIN32 */ Index: util.c =================================================================== --- util.c (revision 19677) +++ util.c (revision 19678) @@ -283,15 +283,11 @@ rb_fatal("Cannot do inplace edit on long filename (%ld characters)", RSTRING_LEN(str)); -#if defined(DJGPP) || defined(__CYGWIN32__) || defined(_WIN32) +#if defined(__CYGWIN32__) || defined(_WIN32) /* Style 0 */ slen = RSTRING_LEN(str); rb_str_cat(str, suffix, extlen); -#if defined(DJGPP) - if (_USE_LFN) return; -#else if (valid_filename(RSTRING_PTR(str))) return; -#endif /* Fooey, style 0 failed. Fix str before continuing. */ rb_str_resize(str, slen); @@ -363,137 +359,7 @@ #endif #endif -#if defined __DJGPP__ -#include <dpmi.h> - -static char dbcs_table[256]; - -int -make_dbcs_table() -{ - __dpmi_regs r; - struct { - unsigned char start; - unsigned char end; - } vec; - int offset; - - memset(&r, 0, sizeof(r)); - r.x.ax = 0x6300; - __dpmi_int(0x21, &r); - offset = r.x.ds * 16 + r.x.si; - - for (;;) { - int i; - dosmemget(offset, sizeof vec, &vec); - if (!vec.start && !vec.end) - break; - for (i = vec.start; i <= vec.end; i++) - dbcs_table[i] = 1; - offset += 2; - } -} - -int -mblen(const char *s, size_t n) -{ - static int need_init = 1; - if (need_init) { - make_dbcs_table(); - need_init = 0; - } - if (s) { - if (n == 0 || *s == 0) - return 0; - else if (!s[1]) - return 1; - return dbcs_table[(unsigned char)*s] + 1; - } - else - return 1; -} - -struct PathList { - struct PathList *next; - char *path; -}; - -struct PathInfo { - struct PathList *head; - int count; -}; - -static int -push_element(const char *path, VALUE vinfo) -{ - struct PathList *p; - struct PathInfo *info = (struct PathInfo *)vinfo; - - p = ALLOC(struct PathList); - MEMZERO(p, struct PathList, 1); - p->path = ruby_strdup(path); - p->next = info->head; - info->head = p; - info->count++; - - return 0; -} - -#include <dirent.h> -int __opendir_flags = __OPENDIR_PRESERVE_CASE; - -char ** -__crt0_glob_function(char *path) -{ - int len = strlen(path); - int i; - char **rv; - char path_buffer[PATH_MAX]; - char *buf = path_buffer; - char *p; - struct PathInfo info; - struct PathList *plist; - - if (PATH_MAX <= len) - buf = ruby_xmalloc(len + 1); - - strncpy(buf, path, len); - buf[len] = '\0'; - - for (p = buf; *p; p += mblen(p, RUBY_MBCHAR_MAXSIZE)) - if (*p == '\\') - *p = '/'; - - info.count = 0; - info.head = 0; - - ruby_glob(buf, 0, push_element, (VALUE)&info); - - if (buf != path_buffer) - ruby_xfree(buf); - - if (info.count == 0) - return 0; - - rv = ruby_xmalloc((info.count + 1) * sizeof (char *)); - - plist = info.head; - i = 0; - while (plist) { - struct PathList *cur; - rv[i] = plist->path; - cur = plist; - plist = plist->next; - ruby_xfree(cur); - i++; - } - rv[i] = 0; - return rv; -} - -#endif - /* mm.c */ #define A ((int*)a) Index: process.c =================================================================== --- process.c (revision 19677) +++ process.c (revision 19678) @@ -28,9 +28,6 @@ #ifdef HAVE_FCNTL_H #include <fcntl.h> #endif -#ifdef __DJGPP__ -#include <process.h> -#endif #include <time.h> #include <ctype.h> @@ -1004,12 +1001,12 @@ return -1; } -#if (defined(MSDOS) && !defined(DJGPP)) || defined(__EMX__) || defined(OS2) +#if defined(MSDOS) || defined(__EMX__) || defined(OS2) { #if defined(__EMX__) || defined(OS2) /* OS/2 emx */ #define COMMAND "cmd.exe" #endif -#if (defined(MSDOS) && !defined(DJGPP)) +#if defined(MSDOS) #define COMMAND "command.com" #endif char *extension; @@ -2667,11 +2664,7 @@ # else if (argc) prog = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" ")); status = system(StringValuePtr(prog)); -# if defined(__DJGPP__) - rb_last_status_set(status == -1 ? 127 : status, 0); -# else rb_last_status_set((status & 0xff) << 8, 0); -# endif # endif rb_run_exec_options(&sarg, NULL); Index: ext/Setup.dj =================================================================== --- ext/Setup.dj (revision 19677) +++ ext/Setup.dj (revision 19678) @@ -1,33 +0,0 @@ -option nodynamic - -#Win32API -bigdecimal -curses -dbm -digest -digest/md5 -digest/rmd160 -digest/sha1 -digest/sha2 -#dl -etc -enumerator -fcntl -gdbm -#iconv -#io/wait -nkf -#openssl -#pty -racc/cparse -readline -ripper -sdbm -#socket -stringio -strscan -syck -#syslog -#tk -#win32ole -zlib Index: ext/socket/socket.c =================================================================== --- ext/socket/socket.c (revision 19677) +++ ext/socket/socket.c (revision 19678) @@ -241,7 +241,7 @@ MakeOpenFile(sock, fp); fp->fd = fd; fp->mode = FMODE_READWRITE|FMODE_DUPLEX; -#if defined(_WIN32) || defined(DJGPP) || defined(__CYGWIN__) || defined(__EMX__) +#if defined(_WIN32) || defined(__CYGWIN__) || defined(__EMX__) fp->mode |= FMODE_BINMODE; #endif if (do_not_reverse_lookup) { Index: ruby.c =================================================================== --- ruby.c (revision 19677) +++ ruby.c (revision 19678) @@ -186,7 +186,7 @@ } #endif -#if defined _WIN32 || defined __CYGWIN__ || defined __DJGPP__ +#if defined _WIN32 || defined __CYGWIN__ static VALUE rubylib_mangled_path(const char *s, unsigned int l) { @@ -356,9 +356,6 @@ #if defined _WIN32 || defined __CYGWIN__ GetModuleFileName(libruby, libpath, sizeof libpath); -#elif defined(DJGPP) - extern char *__dos_argv0; - strncpy(libpath, __dos_argv0, sizeof(libpath) - 1); #elif defined(__EMX__) _execname(libpath, sizeof(libpath) - 1); #endif Index: test/ruby/test_env.rb =================================================================== --- test/ruby/test_env.rb (revision 19677) +++ test/ruby/test_env.rb (revision 19678) @@ -1,7 +1,7 @@ require 'test/unit' class TestEnv < Test::Unit::TestCase - IGNORE_CASE = /djgpp|bccwin|mswin|mingw/ =~ RUBY_PLATFORM + IGNORE_CASE = /bccwin|mswin|mingw/ =~ RUBY_PLATFORM PATH_ENV = "PATH" def setup Index: test/ruby/test_path.rb =================================================================== --- test/ruby/test_path.rb (revision 19677) +++ test/ruby/test_path.rb (revision 19678) @@ -45,7 +45,7 @@ end def test_dirname - if /(bcc|ms)win\d|mingw|cygwin|djgpp|emx/ =~ RUBY_PLATFORM + if /(bcc|ms)win\d|mingw|cygwin|emx/ =~ RUBY_PLATFORM # DOSISH_DRIVE_LETTER assert_equal('C:.', File.dirname('C:')) assert_equal('C:.', File.dirname('C:a')) @@ -101,7 +101,7 @@ assert_equal('/', File.dirname('/a/')) assert_equal('/a', File.dirname('/a/b')) - if /(bcc|ms|cyg)win|mingw|djgpp|emx/ =~ RUBY_PLATFORM + if /(bcc|ms|cyg)win|mingw|emx/ =~ RUBY_PLATFORM # DOSISH_UNC assert_equal('//', File.dirname('//')) assert_equal('//a', File.dirname('//a')) @@ -135,7 +135,7 @@ end def test_basename - if /(bcc|ms)win\d|mingw|cygwin|djgpp|emx/ =~ RUBY_PLATFORM + if /(bcc|ms)win\d|mingw|cygwin|emx/ =~ RUBY_PLATFORM # DOSISH_DRIVE_LETTER assert_equal('', File.basename('C:')) assert_equal('a', File.basename('C:a')) @@ -189,7 +189,7 @@ assert_equal('a', File.basename('/a/')) assert_equal('b', File.basename('/a/b')) - if /(bcc|ms|cyg)win|mingw|djgpp|emx/ =~ RUBY_PLATFORM + if /(bcc|ms|cyg)win|mingw|emx/ =~ RUBY_PLATFORM # DOSISH_UNC assert_equal('/', File.basename('//')) assert_equal('/', File.basename('//a')) Index: test/fileutils/test_fileutils.rb =================================================================== --- test/fileutils/test_fileutils.rb (revision 19677) +++ test/fileutils/test_fileutils.rb (revision 19678) @@ -16,11 +16,11 @@ Dir.chdir tmproot def have_drive_letter? - /djgpp|mswin(?!ce)|mingw|bcc|emx/ =~ RUBY_PLATFORM + /mswin(?!ce)|mingw|bcc|emx/ =~ RUBY_PLATFORM end def have_file_perm? - /djgpp|mswin|mingw|bcc|wince|emx/ !~ RUBY_PLATFORM + /mswin|mingw|bcc|wince|emx/ !~ RUBY_PLATFORM end $fileutils_rb_have_symlink = nil Index: signal.c =================================================================== --- signal.c (revision 19677) +++ signal.c (revision 19678) @@ -44,11 +44,7 @@ #endif #ifndef NSIG -# ifdef DJGPP -# define NSIG SIGMAX -# else -# define NSIG (_SIGMAX + 1) /* For QNX */ -# endif +# define NSIG (_SIGMAX + 1) /* For QNX */ #endif static const struct signals { Index: file.c =================================================================== --- file.c (revision 19677) +++ file.c (revision 19678) @@ -1989,7 +1989,7 @@ o = NIL_P(owner) ? -1 : NUM2INT(owner); g = NIL_P(group) ? -1 : NUM2INT(group); GetOpenFile(obj, fptr); -#if defined(DJGPP) || defined(__CYGWIN32__) || defined(_WIN32) || defined(__EMX__) +#if defined(__CYGWIN32__) || defined(_WIN32) || defined(__EMX__) if (NIL_P(fptr->pathv)) return Qnil; if (chown(RSTRING_PTR(fptr->pathv), o, g) == -1) rb_sys_fail_path(fptr->pathv); @@ -2413,11 +2413,7 @@ #endif #ifndef CharNext /* defined as CharNext[AW] on Windows. */ -# if defined(DJGPP) -# define CharNext(p) ((p) + mblen(p, RUBY_MBCHAR_MAXSIZE)) -# else -# define CharNext(p) ((p) + 1) -# endif +# define CharNext(p) ((p) + 1) #endif #ifdef DOSISH_DRIVE_LETTER -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/