1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
yugui 2008-10-04 13:33:22 +00:00
parent 8dd118c0db
commit ae7ea3332b
13 changed files with 45 additions and 65 deletions

View file

@ -1,3 +1,29 @@
Sat Oct 4 22:30:28 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* 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@yugui.jp> Sat Oct 4 22:14:15 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* djgpp/GNUmakefile.in: removed. Ruby no longer supports djgpp. * djgpp/GNUmakefile.in: removed. Ruby no longer supports djgpp.

8
dln.c
View file

@ -1581,7 +1581,7 @@ dln_find_exe_r(const char *fname, const char *path, char *buf, int size)
} }
if (!path) { if (!path) {
#if defined(MSDOS) || defined(_WIN32) || defined(__MACOS__) #if defined(_WIN32) || defined(__MACOS__)
path = "/usr/local/bin;/usr/ucb;/usr/bin;/bin;."; path = "/usr/local/bin;/usr/ucb;/usr/bin;/bin;.";
#else #else
path = "/usr/local/bin:/usr/ucb:/usr/bin:/bin:."; 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 defined(DOSISH)
if (exe_flag) { if (exe_flag) {
static const char extension[][5] = { static const char extension[][5] = {
#if defined(MSDOS) #if defined(__EMX__) || defined(_WIN32)
".com", ".exe", ".bat",
#elif defined(__EMX__) || defined(_WIN32)
".exe", ".com", ".cmd", ".bat", ".exe", ".com", ".cmd", ".bat",
/* end of __EMX__ or _WIN32 */ /* end of __EMX__ or _WIN32 */
#endif #endif
@ -1741,7 +1739,7 @@ dln_find_1(const char *fname, const char *path, char *fbuf, int size,
} }
goto next; goto next;
} }
#endif /* MSDOS or _WIN32 or __EMX__ */ #endif /* _WIN32 or __EMX__ */
#ifndef __MACOS__ #ifndef __MACOS__
if (stat(fbuf, &st) == 0) { if (stat(fbuf, &st) == 0) {

View file

@ -103,7 +103,7 @@ static int duppair proto((char *, datum));
/* /*
* externals * externals
*/ */
#if !defined sun && !defined MSDOS && !defined _WIN32 && !defined __CYGWIN__ && !defined(errno) #if !defined sun && !defined _WIN32 && !defined __CYGWIN__ && !defined(errno)
extern int errno; extern int errno;
#endif #endif
@ -338,7 +338,7 @@ makroom(register DBM *db, long int hash, int need)
{ {
long newp; long newp;
char twin[PBLKSIZ]; char twin[PBLKSIZ];
#if defined MSDOS || (defined _WIN32 && !defined __CYGWIN__) #if defined _WIN32 && !defined __CYGWIN__
char zer[PBLKSIZ]; char zer[PBLKSIZ];
long oldtail; long oldtail;
#endif #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. * 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. * Fill hole with 0 if made it.
* (hole is NOT read as 0) * (hole is NOT read as 0)

View file

@ -52,7 +52,7 @@ typedef struct {
extern datum nullitem; extern datum nullitem;
#if defined(__STDC__) || defined(MSDOS) #if defined(__STDC__)
#define proto(p) p #define proto(p) p
#else #else
#define proto(p) () #define proto(p) ()

4
gc.c
View file

@ -75,12 +75,8 @@ void *alloca ();
#endif /* __GNUC__ */ #endif /* __GNUC__ */
#ifndef GC_MALLOC_LIMIT #ifndef GC_MALLOC_LIMIT
#if defined(MSDOS)
#define GC_MALLOC_LIMIT 200000
#else
#define GC_MALLOC_LIMIT 8000000 #define GC_MALLOC_LIMIT 8000000
#endif #endif
#endif
#define nomem_error GET_VM()->special_exceptions[ruby_error_nomemory] #define nomem_error GET_VM()->special_exceptions[ruby_error_nomemory]

11
hash.c
View file

@ -2015,18 +2015,7 @@ ruby_setenv(const char *name, const char *value)
} }
len = strlen(name) + strlen(value) + 2; len = strlen(name) + strlen(value) + 2;
environ[i] = ALLOC_N(char, len); environ[i] = ALLOC_N(char, len);
#ifndef MSDOS
snprintf(environ[i],len,"%s=%s",name,value); /* all that work just for this */ 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 */ #endif /* WIN32 */
} }

View file

@ -103,7 +103,7 @@ void xfree(void*);
#undef _WIN32 #undef _WIN32
#endif #endif
#if defined(MSDOS) || defined(_WIN32) || defined(__EMX__) #if defined(_WIN32) || defined(__EMX__)
#define DOSISH 1 #define DOSISH 1
#ifndef _WIN32_WCE #ifndef _WIN32_WCE
# define DOSISH_DRIVE_LETTER # define DOSISH_DRIVE_LETTER

View file

@ -45,7 +45,7 @@ unsigned long ruby_scan_oct(const char *, int, int *);
#define scan_hex ruby_scan_hex #define scan_hex ruby_scan_hex
unsigned long ruby_scan_hex(const char *, int, int *); 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); void ruby_add_suffix(VALUE str, const char *suffix);
#endif #endif

11
io.c
View file

@ -29,11 +29,11 @@
# include <sys/socket.h> # include <sys/socket.h>
#endif #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 # define NO_SAFE_RENAME
#endif #endif
#if defined(MSDOS) || defined(__CYGWIN__) || defined(_WIN32) #if defined(__CYGWIN__) || defined(_WIN32)
# define NO_LONG_FNAME # define NO_LONG_FNAME
#endif #endif
@ -6397,7 +6397,6 @@ rb_f_select(int argc, VALUE *argv, VALUE obj)
} }
#if !defined(MSDOS)
static int static int
io_cntl(int fd, int cmd, long narg, int io_p) 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 #endif
return retval; return retval;
} }
#endif
static VALUE static VALUE
rb_io_ctl(VALUE io, VALUE req, VALUE arg, int io_p) rb_io_ctl(VALUE io, VALUE req, VALUE arg, int io_p)
{ {
#if !defined(MSDOS)
int cmd = NUM2ULONG(req); int cmd = NUM2ULONG(req);
rb_io_t *fptr; rb_io_t *fptr;
long len = 0; long len = 0;
@ -6488,10 +6485,6 @@ rb_io_ctl(VALUE io, VALUE req, VALUE arg, int io_p)
} }
return INT2NUM(retval); return INT2NUM(retval);
#else
rb_notimplement();
return Qnil; /* not reached */
#endif
} }

View file

@ -1001,14 +1001,9 @@ proc_exec_v(char **argv, const char *prog)
return -1; 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" #define COMMAND "cmd.exe"
#endif
#if defined(MSDOS)
#define COMMAND "command.com"
#endif
char *extension; char *extension;
if ((extension = strrchr(prog, '.')) != NULL && STRCASECMP(extension, ".bat") == 0) { 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(); before_exec();
execv(prog, argv); execv(prog, argv);
preserving_errno(after_exec()); preserving_errno(after_exec());
@ -1085,14 +1080,7 @@ rb_proc_exec(const char *str)
if (nl) s = nl; if (nl) s = nl;
} }
if (*s != ' ' && !ISALPHA(*s) && strchr("*?{}[]<>()~&|\\$;'`\"\n",*s)) { if (*s != ' ' && !ISALPHA(*s) && strchr("*?{}[]<>()~&|\\$;'`\"\n",*s)) {
#if defined(MSDOS) #if defined(__CYGWIN32__) || defined(__EMX__)
int status;
before_exec();
status = system(str);
after_exec();
if (status != -1)
exit(status);
#elif defined(__CYGWIN32__) || defined(__EMX__)
char fbuf[MAXPATHLEN]; char fbuf[MAXPATHLEN];
char *shell = dln_find_exe_r("sh", 0, fbuf, sizeof(fbuf)); char *shell = dln_find_exe_r("sh", 0, fbuf, sizeof(fbuf));
int status = -1; 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 * expansion. If +command+ is a two-element array, the first
* element is the command to be executed, and the second argument is * 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 * used as the <code>argv[0]</code> value, which may show up in process
* listings. In MSDOS environments, the command is executed in a * listings. In order to execute the command, one of the <code>exec(2)</code>
* subshell; otherwise, one of the <code>exec(2)</code> system calls is * system calls is used, so the running command may inherit some of the environment
* used, so the running command may inherit some of the environment of * of the original program (including open file descriptors).
* the original program (including open file descriptors).
* *
* The hash arguments, env and options, are same as * The hash arguments, env and options, are same as
* <code>system</code> and <code>spawn</code>. * <code>system</code> and <code>spawn</code>.

9
ruby.c
View file

@ -1471,15 +1471,6 @@ ruby_prog_init(void)
rb_define_hooked_variable("$PROGRAM_NAME", &rb_progname, 0, set_arg0); rb_define_hooked_variable("$PROGRAM_NAME", &rb_progname, 0, set_arg0);
rb_define_global_const("ARGV", rb_argv); 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 void

View file

@ -126,7 +126,7 @@ extern char *strchr();
#ifndef DLL_IMPORT #ifndef DLL_IMPORT
#define DLL_IMPORT #define DLL_IMPORT
#endif #endif
#if !defined(OS2) && !defined(MSDOS) && defined(HAVE_TZNAME) #if !defined(OS2) && defined(HAVE_TZNAME)
extern DLL_IMPORT char *tzname[2]; extern DLL_IMPORT char *tzname[2];
#ifdef HAVE_DAYLIGHT #ifdef HAVE_DAYLIGHT
extern DLL_IMPORT int daylight; extern DLL_IMPORT int daylight;

2
util.c
View file

@ -191,7 +191,7 @@ ruby_strtoul(const char *str, char **endptr, int base)
# define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR) # define S_ISDIR(m) ((m & S_IFMT) == S_IFDIR)
#endif #endif
#if defined(MSDOS) || defined(__CYGWIN32__) || defined(_WIN32) #if defined(__CYGWIN32__) || defined(_WIN32)
/* /*
* Copyright (c) 1993, Intergraph Corporation * Copyright (c) 1993, Intergraph Corporation
* *