ruby-changes:8151
From: yugui <ko1@a...>
Date: Sat, 4 Oct 2008 22:33:43 +0900 (JST)
Subject: [ruby-changes:8151] Ruby:r19679 (trunk): * dln.c: Ruby no longer supports MS-DOS.
yugui 2008-10-04 22:33:22 +0900 (Sat, 04 Oct 2008) New Revision: 19679 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19679 Log: * dln.c: Ruby no longer supports MS-DOS. * ext/sdbm/_sdbm.c: ditto. * ext/sdbm/sdbm.h: ditto. * gc.c: ditto. * hash.c: ditto. * include/ruby/defines.h: ditto. * include/ruby/util.h: ditto. * io.c: ditto. * process.c: ditto. * ruby.c: ditto. * strftime.c: ditto. * util.c: ditto. Modified files: trunk/ChangeLog trunk/dln.c trunk/ext/sdbm/_sdbm.c trunk/ext/sdbm/sdbm.h trunk/gc.c trunk/hash.c trunk/include/ruby/defines.h trunk/include/ruby/util.h trunk/io.c trunk/process.c trunk/ruby.c trunk/strftime.c trunk/util.c Index: include/ruby/defines.h =================================================================== --- include/ruby/defines.h (revision 19678) +++ include/ruby/defines.h (revision 19679) @@ -103,7 +103,7 @@ #undef _WIN32 #endif -#if defined(MSDOS) || defined(_WIN32) || defined(__EMX__) +#if defined(_WIN32) || defined(__EMX__) #define DOSISH 1 #ifndef _WIN32_WCE # define DOSISH_DRIVE_LETTER Index: include/ruby/util.h =================================================================== --- include/ruby/util.h (revision 19678) +++ include/ruby/util.h (revision 19679) @@ -45,7 +45,7 @@ #define scan_hex ruby_scan_hex unsigned long ruby_scan_hex(const char *, int, int *); -#if defined(MSDOS) || defined(__CYGWIN32__) || defined(_WIN32) +#if defined(__CYGWIN32__) || defined(_WIN32) void ruby_add_suffix(VALUE str, const char *suffix); #endif Index: ChangeLog =================================================================== --- ChangeLog (revision 19678) +++ ChangeLog (revision 19679) @@ -1,3 +1,29 @@ +Sat Oct 4 22:30:28 2008 Yuki Sonoda (Yugui) <yugui@y...> + + * dln.c: Ruby no longer supports MS-DOS. + + * ext/sdbm/_sdbm.c: ditto. + + * ext/sdbm/sdbm.h: ditto. + + * gc.c: ditto. + + * hash.c: ditto. + + * include/ruby/defines.h: ditto. + + * include/ruby/util.h: ditto. + + * io.c: ditto. + + * process.c: ditto. + + * ruby.c: ditto. + + * strftime.c: ditto. + + * util.c: ditto. + Sat Oct 4 22:14:15 2008 Yuki Sonoda (Yugui) <yugui@y...> * djgpp/GNUmakefile.in: removed. Ruby no longer supports djgpp. Index: io.c =================================================================== --- io.c (revision 19678) +++ io.c (revision 19679) @@ -29,11 +29,11 @@ # include <sys/socket.h> #endif -#if defined(MSDOS) || defined(__BOW__) || defined(__CYGWIN__) || defined(_WIN32) || defined(__EMX__) || defined(__BEOS__) +#if defined(__BOW__) || defined(__CYGWIN__) || defined(_WIN32) || defined(__EMX__) || defined(__BEOS__) # define NO_SAFE_RENAME #endif -#if defined(MSDOS) || defined(__CYGWIN__) || defined(_WIN32) +#if defined(__CYGWIN__) || defined(_WIN32) # define NO_LONG_FNAME #endif @@ -6397,7 +6397,6 @@ } -#if !defined(MSDOS) static int io_cntl(int fd, int cmd, long narg, int io_p) { @@ -6417,12 +6416,10 @@ #endif return retval; } -#endif static VALUE rb_io_ctl(VALUE io, VALUE req, VALUE arg, int io_p) { -#if !defined(MSDOS) int cmd = NUM2ULONG(req); rb_io_t *fptr; long len = 0; @@ -6488,10 +6485,6 @@ } return INT2NUM(retval); -#else - rb_notimplement(); - return Qnil; /* not reached */ -#endif } Index: gc.c =================================================================== --- gc.c (revision 19678) +++ gc.c (revision 19679) @@ -75,12 +75,8 @@ #endif /* __GNUC__ */ #ifndef GC_MALLOC_LIMIT -#if defined(MSDOS) -#define GC_MALLOC_LIMIT 200000 -#else #define GC_MALLOC_LIMIT 8000000 #endif -#endif #define nomem_error GET_VM()->special_exceptions[ruby_error_nomemory] Index: strftime.c =================================================================== --- strftime.c (revision 19678) +++ strftime.c (revision 19679) @@ -126,7 +126,7 @@ #ifndef DLL_IMPORT #define DLL_IMPORT #endif -#if !defined(OS2) && !defined(MSDOS) && defined(HAVE_TZNAME) +#if !defined(OS2) && defined(HAVE_TZNAME) extern DLL_IMPORT char *tzname[2]; #ifdef HAVE_DAYLIGHT extern DLL_IMPORT int daylight; Index: dln.c =================================================================== --- dln.c (revision 19678) +++ dln.c (revision 19679) @@ -1581,7 +1581,7 @@ } if (!path) { -#if defined(MSDOS) || defined(_WIN32) || defined(__MACOS__) +#if defined(_WIN32) || defined(__MACOS__) path = "/usr/local/bin;/usr/ucb;/usr/bin;/bin;."; #else path = "/usr/local/bin:/usr/ucb:/usr/bin:/bin:."; @@ -1713,9 +1713,7 @@ #if defined(DOSISH) if (exe_flag) { static const char extension[][5] = { -#if defined(MSDOS) - ".com", ".exe", ".bat", -#elif defined(__EMX__) || defined(_WIN32) +#if defined(__EMX__) || defined(_WIN32) ".exe", ".com", ".cmd", ".bat", /* end of __EMX__ or _WIN32 */ #endif @@ -1741,7 +1739,7 @@ } goto next; } -#endif /* MSDOS or _WIN32 or __EMX__ */ +#endif /* _WIN32 or __EMX__ */ #ifndef __MACOS__ if (stat(fbuf, &st) == 0) { Index: util.c =================================================================== --- util.c (revision 19678) +++ util.c (revision 19679) @@ -191,7 +191,7 @@ # define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR) #endif -#if defined(MSDOS) || defined(__CYGWIN32__) || defined(_WIN32) +#if defined(__CYGWIN32__) || defined(_WIN32) /* * Copyright (c) 1993, Intergraph Corporation * Index: process.c =================================================================== --- process.c (revision 19678) +++ process.c (revision 19679) @@ -1001,14 +1001,9 @@ return -1; } -#if defined(MSDOS) || defined(__EMX__) || defined(OS2) +#if defined(__EMX__) || defined(OS2) { -#if defined(__EMX__) || defined(OS2) /* OS/2 emx */ #define COMMAND "cmd.exe" -#endif -#if defined(MSDOS) -#define COMMAND "command.com" -#endif char *extension; if ((extension = strrchr(prog, '.')) != NULL && STRCASECMP(extension, ".bat") == 0) { @@ -1034,7 +1029,7 @@ } } } -#endif /* MSDOS or __EMX__ */ +#endif /* __EMX__ */ before_exec(); execv(prog, argv); preserving_errno(after_exec()); @@ -1085,14 +1080,7 @@ if (nl) s = nl; } if (*s != ' ' && !ISALPHA(*s) && strchr("*?{}[]<>()~&|\\$;'`\"\n",*s)) { -#if defined(MSDOS) - int status; - before_exec(); - status = system(str); - after_exec(); - if (status != -1) - exit(status); -#elif defined(__CYGWIN32__) || defined(__EMX__) +#if defined(__CYGWIN32__) || defined(__EMX__) char fbuf[MAXPATHLEN]; char *shell = dln_find_exe_r("sh", 0, fbuf, sizeof(fbuf)); int status = -1; @@ -1663,10 +1651,9 @@ * expansion. If +command+ is a two-element array, the first * element is the command to be executed, and the second argument is * used as the <code>argv[0]</code> value, which may show up in process - * listings. In MSDOS environments, the command is executed in a - * subshell; otherwise, one of the <code>exec(2)</code> system calls is - * used, so the running command may inherit some of the environment of - * the original program (including open file descriptors). + * listings. In order to execute the command, one of the <code>exec(2)</code> + * system calls is used, so the running command may inherit some of the environment + * of the original program (including open file descriptors). * * The hash arguments, env and options, are same as * <code>system</code> and <code>spawn</code>. Index: ext/sdbm/_sdbm.c =================================================================== --- ext/sdbm/_sdbm.c (revision 19678) +++ ext/sdbm/_sdbm.c (revision 19679) @@ -103,7 +103,7 @@ /* * externals */ -#if !defined sun && !defined MSDOS && !defined _WIN32 && !defined __CYGWIN__ && !defined(errno) +#if !defined sun && !defined _WIN32 && !defined __CYGWIN__ && !defined(errno) extern int errno; #endif @@ -338,7 +338,7 @@ { long newp; char twin[PBLKSIZ]; -#if defined MSDOS || (defined _WIN32 && !defined __CYGWIN__) +#if defined _WIN32 && !defined __CYGWIN__ char zer[PBLKSIZ]; long oldtail; #endif @@ -365,7 +365,7 @@ * here, as sdbm_store will do so, after it inserts the incoming pair. */ -#if defined MSDOS || (defined _WIN32 && !defined __CYGWIN__) +#if defined _WIN32 && !defined __CYGWIN__ /* * Fill hole with 0 if made it. * (hole is NOT read as 0) Index: ext/sdbm/sdbm.h =================================================================== --- ext/sdbm/sdbm.h (revision 19678) +++ ext/sdbm/sdbm.h (revision 19679) @@ -52,7 +52,7 @@ extern datum nullitem; -#if defined(__STDC__) || defined(MSDOS) +#if defined(__STDC__) #define proto(p) p #else #define proto(p) () Index: hash.c =================================================================== --- hash.c (revision 19678) +++ hash.c (revision 19679) @@ -2015,18 +2015,7 @@ } len = strlen(name) + strlen(value) + 2; environ[i] = ALLOC_N(char, len); -#ifndef MSDOS snprintf(environ[i],len,"%s=%s",name,value); /* all that work just for this */ -#else - /* MS-DOS requires environment variable names to be in uppercase */ - /* [Tom Dinger, 27 August 1990: Well, it doesn't _require_ it, but - * some utilities and applications may break because they only look - * for upper case strings. (Fixed strupr() bug here.)] - */ - strcpy(environ[i],name); strupr(environ[i]); - sprintf(environ[i] + strlen(name),"=%s", value); -#endif /* MSDOS */ - #endif /* WIN32 */ } Index: ruby.c =================================================================== --- ruby.c (revision 19678) +++ ruby.c (revision 19679) @@ -1471,15 +1471,6 @@ rb_define_hooked_variable("$PROGRAM_NAME", &rb_progname, 0, set_arg0); rb_define_global_const("ARGV", rb_argv); - -#ifdef MSDOS - /* - * There is no way we can refer to them from ruby, so close them to save - * space. - */ - (void)fclose(stdaux); - (void)fclose(stdprn); -#endif } void -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/