From ae7ea3332b07c83ee050c88cd902070689fd582f Mon Sep 17 00:00:00 2001 From: yugui Date: Sat, 4 Oct 2008 13:33:22 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 26 ++++++++++++++++++++++++++ dln.c | 8 +++----- ext/sdbm/_sdbm.c | 6 +++--- ext/sdbm/sdbm.h | 2 +- gc.c | 4 ---- hash.c | 11 ----------- include/ruby/defines.h | 2 +- include/ruby/util.h | 2 +- io.c | 11 ++--------- process.c | 25 ++++++------------------- ruby.c | 9 --------- strftime.c | 2 +- util.c | 2 +- 13 files changed, 45 insertions(+), 65 deletions(-) diff --git a/ChangeLog b/ChangeLog index a08c7397e9..aa9e6b1d9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +Sat Oct 4 22:30:28 2008 Yuki Sonoda (Yugui) + + * 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) * djgpp/GNUmakefile.in: removed. Ruby no longer supports djgpp. diff --git a/dln.c b/dln.c index 8896d5f6b1..4be1e006fb 100644 --- a/dln.c +++ b/dln.c @@ -1581,7 +1581,7 @@ dln_find_exe_r(const char *fname, const char *path, char *buf, int size) } 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 @@ dln_find_1(const char *fname, const char *path, char *fbuf, int size, #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 @@ dln_find_1(const char *fname, const char *path, char *fbuf, int size, } goto next; } -#endif /* MSDOS or _WIN32 or __EMX__ */ +#endif /* _WIN32 or __EMX__ */ #ifndef __MACOS__ if (stat(fbuf, &st) == 0) { diff --git a/ext/sdbm/_sdbm.c b/ext/sdbm/_sdbm.c index 1d81778193..5668c2c184 100644 --- a/ext/sdbm/_sdbm.c +++ b/ext/sdbm/_sdbm.c @@ -103,7 +103,7 @@ static int duppair proto((char *, datum)); /* * 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 @@ makroom(register DBM *db, long int hash, int need) { 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 @@ makroom(register DBM *db, long int hash, int need) * 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) diff --git a/ext/sdbm/sdbm.h b/ext/sdbm/sdbm.h index ce8f54c4d4..0c7ed1ba9b 100644 --- a/ext/sdbm/sdbm.h +++ b/ext/sdbm/sdbm.h @@ -52,7 +52,7 @@ typedef struct { extern datum nullitem; -#if defined(__STDC__) || defined(MSDOS) +#if defined(__STDC__) #define proto(p) p #else #define proto(p) () diff --git a/gc.c b/gc.c index ebfee1180f..bbbac05320 100644 --- a/gc.c +++ b/gc.c @@ -75,12 +75,8 @@ void *alloca (); #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] diff --git a/hash.c b/hash.c index 6ad15a80e0..41836ea6a9 100644 --- a/hash.c +++ b/hash.c @@ -2015,18 +2015,7 @@ ruby_setenv(const char *name, const char *value) } 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 */ } diff --git a/include/ruby/defines.h b/include/ruby/defines.h index 6a25bc3c93..acd01d862a 100644 --- a/include/ruby/defines.h +++ b/include/ruby/defines.h @@ -103,7 +103,7 @@ void xfree(void*); #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 diff --git a/include/ruby/util.h b/include/ruby/util.h index e6e6c95ca4..fc5963c3a2 100644 --- a/include/ruby/util.h +++ b/include/ruby/util.h @@ -45,7 +45,7 @@ unsigned long ruby_scan_oct(const char *, int, int *); #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 diff --git a/io.c b/io.c index 65470637e0..354edd7ede 100644 --- a/io.c +++ b/io.c @@ -29,11 +29,11 @@ # include #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 @@ rb_f_select(int argc, VALUE *argv, VALUE obj) } -#if !defined(MSDOS) static int io_cntl(int fd, int cmd, long narg, int io_p) { @@ -6417,12 +6416,10 @@ io_cntl(int fd, int cmd, long narg, int io_p) #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 @@ rb_io_ctl(VALUE io, VALUE req, VALUE arg, int io_p) } return INT2NUM(retval); -#else - rb_notimplement(); - return Qnil; /* not reached */ -#endif } diff --git a/process.c b/process.c index c2dfb61c37..8386499d5c 100644 --- a/process.c +++ b/process.c @@ -1001,14 +1001,9 @@ proc_exec_v(char **argv, const char *prog) 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 @@ proc_exec_v(char **argv, const char *prog) } } } -#endif /* MSDOS or __EMX__ */ +#endif /* __EMX__ */ before_exec(); execv(prog, argv); preserving_errno(after_exec()); @@ -1085,14 +1080,7 @@ rb_proc_exec(const char *str) 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 @@ rb_exec_arg_fixup(struct rb_exec_arg *e) * 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 argv[0] value, which may show up in process - * listings. In MSDOS environments, the command is executed in a - * subshell; otherwise, one of the exec(2) 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 exec(2) + * 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 * system and spawn. diff --git a/ruby.c b/ruby.c index 462d45a2b9..d326ca272e 100644 --- a/ruby.c +++ b/ruby.c @@ -1471,15 +1471,6 @@ ruby_prog_init(void) 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 diff --git a/strftime.c b/strftime.c index 0f5214990f..1c2dc6ce4a 100644 --- a/strftime.c +++ b/strftime.c @@ -126,7 +126,7 @@ extern char *strchr(); #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; diff --git a/util.c b/util.c index 95e2c0bfe8..ab993693b9 100644 --- a/util.c +++ b/util.c @@ -191,7 +191,7 @@ ruby_strtoul(const char *str, char **endptr, int base) # 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 *